Python realizes "Ebbinghaus" Memory curve table __python

Source: Internet
Author: User

Herman Aibin (Hermann ebbinghaus 1850.1.24~1909.2.26), German psychologist .

1, review the principle

Interval: 20 minutes 1 hours 8 hours 1 days 2 days 6 days 31 days

Re-learning saving reading time percentages: 58.2 44.2 35.8 33.7 27.8 25.4 21.1

2, review the point of determination

People's memory cycle is divided into short-term memory and long-term memory two kinds.

The first memory cycle is 5 minutes.

The second memory cycle is 30 minutes.

The third memory cycle is 12 hours.

These three memory cycles belong to the category of short-term memory.

Here are some of the more important cycles.

The fourth memory cycle is 1 days.

The fifth memory cycle is 2 days.

The sixth memory cycle is 4 days.

The seventh memory cycle is 7 days.

The eighth memory cycle is 15 days.

The above 8 cycles apply to the back lexical, as a large back word of the circulation of 8 review points, can maximize the efficiency of the word back

3. My own point of time

I chose a more regular point of time as my own memory point:

5 minutes 30 minutes 12 hours 1 days 2 days 4 days 8 days 16 days

5 minutes and 30 minutes are realized in one memory, and it takes more than 30 minutes to memorize a word unit.

The 16-day review will be more efficient, flexible and therefore no longer mandatory memory plan.

Therefore, the final memory point is:

Now 0.5 days 1 days 2 days 4 days 8 days (total memory Review 6 times to complete the memory of the unit)

4. Python implementation

The

    time module, list structure, dict structure, and the logical branch structure of for, while, if.

Import time LISTNUM = 20 # unit Total wordlist = [[] for I in range (LISTNUM + 1)] # unit 1th to 4th for J in Range (1,5): # Start At time: "Aug": 2010-8-26 21:00 t = time.mktime (Time.strptime ("Aug", "%y%b%d%H")) # print ' = = Wordlist ', j, ' = = = ' t + = 60*60*12* (j-1) for i in [0, 0.5, 1, 2, 4, 8]: T + = 60*60*24*i c = time.ctime (t) p = TIME.STRP Time (c) s = Time.strftime ("%y-%b-%d%H", p) wordlist[j].append (s) # print S # 5th to unit 8th for J in range (5, 9): # STA RT at time: "Aug": 2010-8-30 21:00 t = time.mktime (Time.strptime ("Aug", "%y%b%d%H")) # print ' = = = Wordlist ', j, ' = = = ' t + = 60*60*12* (j-5) for i in [0, 0.5, 1, 2, 4, 8]: T + = 60*60*24*i c = time.ctime (t) p = Time.st Rptime (c) s = Time.strftime ("%y-%b-%d%H", p) wordlist[j].append (s) # print S # 9th to unit 20th for J in range (9, LISTNUM + 1: # Start at time: "Sep": 2010-9-01 21:00 t = time.mktime (Time.strptime ("Aug", "%y%b%d%H") ) # print ' = = Wordlist', j, ' = = = ' t + = 60*60*12* (j-5) for i in [0, 0.5, 1, 2, 4, 8]: T + = 60*60*24*i c = time.ctime (t) p = time.strptime (c) s = Time.strftime ("%y-%b-%d%H", p) wordlist[j].append (s) # print S # time point as key to build dictionary storage structure J = 1 timedict = {} while J <= Listnum:for listtime in wordlist[j]: if Listtime not in timedict:timedict[listtime] = [j] else:timedict[Listtime ].append (j) j = 1 # print ' = = Timedict = = ' # print Timedict # store "Ebbinghaus" schedule in chronological order timelist = [] for i in Timedict.keys (): t = time.mktime (Time.strptime (i, "%y-%b-%d%H")) Timelist.append (t) timelist.sort () for I in Range (Len (timeli ST): c = Time.ctime (Timelist[i]) p = time.strptime (c) s = Time.strftime ("%y-%b-%d%H", p) timelist[i] = s # print ' = = = Timelist = = ' # print Timelist # print "Ebbinghaus" Memory schedule for J in timelist:print ' = = ', j, ' = = ' temp = Timedict[j by chronological order For i in Temp:print ' wordlist ', I

The output results are:

>>> = = 2010-aug-26 = = = Wordlist 1 = 2010-aug-27 = = = wordlist 1 wordlist 2 ... # omit ... # omitting ... # omit = = 20 10-aug-29 = = = Wordlist 3 = 2010-aug-29 = = Wordlist 4 = 2010-aug-30 = = Wordlist 1 = 2010-aug-30 = = Wor Dlist 2 wordlist 5 = 2010-aug-31 3 = = wordlist wordlist 5 wordlist 6 = 2010-aug-31 = = wordlist 4 wordlist 6 Wo Rdlist 7 = = 2010-sep-01 = = wordlist 5 wordlist 7 wordlist 8 = = 2010-sep-01 = = Wordlist 6 wordlist 8 wordlist 9 ... ... # omit ... # omit = = 2010-sep-21-Wordlist = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = St = = = 2010-sep-22 = = Wordlist >>>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.