Share your repls and programming experiences

← Back to all posts
[LEARN] SpacedRem - Memorize with Spaced Repetition
Smart0ne (730)

You all have had that time: you're sitting comfortably, surfing YouTube (totally not me), and suddenly, you realize you have a major exam coming next week. It's not too late to start studying, and maybe you can pull off that good mark. You plop down, grab your notes, and ... you're greeted with 20 pages full of vocabulary, deep concept exploration, etc. How in the world are you supposed to consume all of that, effectively and quickly?


Spaced repetition is a studying technique where your weaknesses are shown you more often than your strengths. This requires user feedback on how confident you know the answer. Here, we will be using flashcards.

The Nitty-Gritty Dirt

There are some technical questions on how this works, so we will review them here.

How do you find weaknesses?

When you're faced with a flashcard, you can reveal the answer. Now, you need to rate your confidence from 1 to 5. After that, your overall confidence will be updated with the following formula:

1 x (your 4th last confidence rating) + 2 x (your 3rd last confidence rating) + 4 x (your 2nd last confidence rating) + 8 x (your last confidence rating).

If any of the ratings don't exist (i.e. you only rated it thrice, so you don't have a 4th last confidence rating), then that rating becomes 0.

The program will find the flashcards with the lowest confidence rating, and then pick a random one out of those. It will display the flashcard, and you can repeat the process.

What's the motivation behind the formula to calculate your overall confidence?

This formula is a weighted average of your last 4 confidence ratings. The more closer your rating is to the present time, the more accurate it is. Therefore, the weights of each rating are bigger as you come closer to the current time.

I'm not exactly sure why I chose to have the weights in a geometric sequence, but it was probably due to the fact that the learning curve on which spaced repetition is based on, is an exponential graph.

What learning curve?

The learning curve is a graph that models how much knowledge you remember over time. The more you are exposed to a topic, the flatter the curve becomes.

Here, the learning curve starts at 100%, and exponentially decreases. The green dashed line after the first blue part is what should've happened if you never reviewed what you learned. But once you review it again (Day 1), you go back to 100%, and then it decreases again. But pay attention to how flat the curve is. The second curve is flatter than the first curve, so you can hold the information for a longer period of time. Now review it again (Day 3)! The curve gets even flatter. Again (Day 6)! The curve gets even flatter.

This is essentially how repetition helps you retain knowledge for longer periods of time.

How do you implement this exponential decrease?

The way this is done isn't very effective. Basically, for every flashcard you review, you subtract 5 from the overall confidence of all the other flashcards.

However, this doesn't correctly show how the learning curve works, so subtracting 5 each time makes a linear graph, not an exponential one. Plus, the amount of times you review it is another factor that should be considered. But for now, it'll just be like this.

Planned Updates

For the next update, I'm definitely going to improve the exponential decrease. I possibly might improve the algorithm that finds weaknesses (neural nets?), but I'll see if it's okay right now.

When studying flashcards, I might add checkpoints and show the amount of times you've studied this flashcard. To ease convenience, I might allow you to export your study session, so you'll be able to start wherever you stopped.

I might also add the feature where you can make flashcards inside the program, and in a later update, I'm going to move this project to HTML/CSS/Javascript. :P Might need some help on that though.


For a quick guide on how this works.

This is where you start. After you finish the tutorial (or you just skip it), you come here:

Once you import your flashcards, you enter the studying page.

Press any key to see the answer ...

... and then rate your confidence on how well you knew the answer.

Repeat as many times as needed, until you think you've memorized everything. Test yourself (make a practice test, etc.) and confirm you didn't forget anything, and you're ready to go! Just be sure to review your flashcards once in a while, and if needed, use SpacedRem again.


Thanks for viewing this project. :)

If you find any bugs, please comment below.
If you want to suggest a feature, please also comment below.
If this technique didn't work for you, please also very comment (tell me your issue) below, thank you very much.

;) Hope this helps.

Note: As for when the next update will come, I'm currently thinking of posting the second version in a few weeks.

RayhanADev (1967)

Wow, that's interesting :o
I'm a bit of a psychology nerd, so I'm super intrigued by your confidence formula :)