Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine SM-2 algorithm #33

Merged
merged 2 commits into from
Dec 25, 2024
Merged

Refine SM-2 algorithm #33

merged 2 commits into from
Dec 25, 2024

Conversation

jaysonvirissimo
Copy link
Owner

@jaysonvirissimo jaysonvirissimo commented Dec 22, 2024

Attempt to more accurately capture this SM-2 algorithm:

algorithm SM-2 is
    input:  user grade q
            repetition number n
            easiness factor EF
            interval I
    output: updated values of n, EF, and I

    if q ≥ 3 (correct response) then
        if n = 0 then
            I ← 1
        else if n = 1 then
            I ← 6
        else
            I ← round(I × EF)
        end if
        increment n
    else (incorrect response)
        n ← 0
        I ← 1
    end if
    
    EF ← EF + (0.1 − (5 − q) × (0.08 + (5 − q) × 0.02))
    if EF < 1.3 then
        EF ← 1.3
    end if
    
    return (n, EF, I)

@jaysonvirissimo jaysonvirissimo merged commit 86db0ea into master Dec 25, 2024
8 checks passed
@jaysonvirissimo jaysonvirissimo deleted the refine-sm2 branch December 25, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant