2016-12-09 18 views
2

是否有可能在1000000和9999999之間生成容易記憶的隨機數字?生成易於記憶的數字

我知道術語easy to remember是相對的,但我相信,對於典型的人次數爲331332是很容易,537106記(是嗎?)

使用案例。我正在爲應用程序中的人生成唯一的號碼,並認爲我可以通過分配easy numbers來嘗試讓人們更容易。我玩這個遊戲的方式是,第一個註冊的人可以獲得簡單的數字,並從那裏減輕壓力。

如果你已經看到了同樣在任何編程語言,你可以張貼的靈感給他人

有一個similar question here但在本質上是字母數字,這是六年前

+2

只有當他們遵循某種模式時 - 根據定義它們將成爲非隨機的。 – martineau

+1

這是一個令人難以置信的廣泛話題,似乎是兩個不同的問題。一個是「什麼讓一個數字容易記住」,這是超出了範圍。這不僅僅是一個心理學研究項目。二是「如何生成容易記憶的數字」,這一切都取決於第一步。 –

+0

如果你認爲容易記住的數字有更多的重複數字,那麼你可以產生隨機數字,並計算有多少數字重複,並選擇那些重複數字4。 – Atirag

回答

2

在這裏,我找到有些事情做了許多令人難忘: http://www.slideshare.net/cntryrckr69/what-makes-a-number-memorable

我在基於Python的實現了它的一些這些東西

下面的代碼是什麼樣子:

import random 

def easynum(num): 
    num = str(num) 

    if len(set(num)) <= 2: # common characters eg. 1114111 
     print("common") 
     return True 
    if num == num[::-1]: # its the same backwards eg. 1234321 
     print("reversible") 
     return True 
    if all(x <= y for x, y in zip(list(num), list(num)[1:])): # increasing, e.g. 123456789 
     print("increasing") 
     return True 
    if all(x >= y for x, y in zip(list(num), list(num)[1:])): # decreasing 
     print("decreasing") 
     return True 


for count in range(10): 
    rand = random.randint(1000000, 9999999) 
    while easynum(rand) == None: 
     rand = random.randint(1000000, 9999999) 
    print(rand) 

這是我得到的輸出:

reversible 
5691965 
reversible 
9585859 
increasing 
1112557 
reversible 
9057509 
reversible 
3831383 
decreasing 
8322000 
increasing 
1122356 
common 
4884484 
decreasing 
9887320 
common 
4004040 
1

我能想到的一些簡單易記的模式:

1234321 (half reversed) 
1234567 (in order) 
1231231 (repeating) 
7654321 (reverse order) 
2468024 (even in order) 
1357135 (odd in order) 
1212121 (alternating) 

顯然你可以想到更多。有一個不同模式的圖書館。從庫中隨機選擇一個模式,然後在模式的約束範圍內隨機填充該模式。例如,您只能選擇「定單」模式的起始數字,以下數字將取決於起始數字。

+0

我認爲重複數字的數字也會被認爲容易記住,'116633' –