User:Greeninvisibledreams/Collatz猜想

未解到嘅數學問題係咪凡親係正數開始嘅Collatz數列都會係 1 字收尾㗎?
標示小數字嘅軌道有向圖,雙數除外。Collatz猜想話所有嘅道路都會指去 1。

Collatz猜想粵拼ko1 lats4 caai1 soeng2,英文:Collatz conjecture,中文:奇偶歸一猜想3n+1猜想冰雹猜想角谷猜想哈塞猜想烏拉姆猜想敘拉古猜想)係一個數學猜想,個猜想係噉樣嘅:首先,你求祈揀個正數。晒呢,如果個數字係雙數嚟嘅話就將佢除以二,如果係單數嘅話就將佢乘三加一。跟住就用呢個方法嚟係噉將呢個數字係噉變。個猜想就係任你初頭嗰陣時揀乜嘢正數都好,所整出嚟嘅數列最後都係會達到 1 呢個數字嘅。

個猜想係跟諗起者Lothar Collatz名嘅,諗起猜想嘅年份係Collatz收到博士之後嘅兩年[1]。個猜想亦都叫做3n+1猜想、Ulam猜想(跟Stanisław Ulam名),角谷問題(跟角谷静夫名)、Thwaites猜想(跟Bryan Thwaites爵士名)、Hasse運算(跟Helmut Hasse名)同埋Syracuse問題[2][3] 啲數字嘅數列有時會叫做冰雹數列(因為啲數字就好似喺雲上高嘅冰雹噉又升又跌)[4][5]或者驚人嘅數字(wondrous numbers)[6]

艾狄胥(Erdős Pál)曾經就Collatz猜想做過評論:「數學未曾為呢種問題做好準備。」[7]。佢亦都提供咗五百鈫美金作為答案嘅獎賞[8]Jeffrey Lagarias喺2010年講過話Collatz猜想「係一個難到抽筋嘅問題,遠遠超於現今嘅數學。」[9]

問題嘅陳述 編輯

我哋喺正數嘅前提入面考慮以下嘅變法:

  • 如果個數字係雙數嘅話,將個數字除以二
  • 如果個數字係單數嘅話,將個數字乘三加一

商餘計算嘅寫法就會得出呢個函數 

 

再用 嚟不停噉變個數字,喺過程中整出咗一個數列。

噉Collatz猜想就話:「無論你揀咩數字都好,個數字經過呢個過程之後一定會達到 1 呢個數字」

編輯

計數機驗證 編輯

我哋可以寫以下嘅Python程式嚟睇下某個數字會晤會達到。呢個程式一到 1 就會停,噉就可以唔使1→4→2→1噉循環(我哋當然可以用其他程式語言嚟寫呢個程式,呢處揀咗Python嚟寫只不過係為咗清晰度)。

def collatz(number):
    while number != 1:
        if number % 2 == 0:
            number = number // 2
        elif number % 2 == 1:
            number = number*3 + 1
        print(number)

collatz(int(input('輸入一個正整數')))

編輯

  1. O'Connor, J.J.; Robertson, E.F. (2006). "Lothar Collatz". St Andrews University School of Mathematics and Statistics, Scotland.
  2. Maddux, Cleborne D.; Johnson, D. Lamont (1997). Logo: A Retrospective. New York: Haworth Press. p. 160. ISBN 0-7890-0374-0. The problem is also known by several other names, including: Ulam's conjecture, the Hailstone problem, the Syracuse problem, Kakutani's problem, Hasse's algorithm, and the Collatz problem.
  3. 根據 Template:Named ref p. 4, 「Syracuse問題」呢個名係由Hasse喺1950年代去訪問雪城大學嗰陣時提議嘅。
  4. Pickover, Clifford A. (2001). Wonders of Numbers. Oxford: Oxford University Press. pp. 116–118. ISBN 0-19-513342-0.
  5. "Hailstone Number". MathWorld. Wolfram Research.
  6. Hofstadter, Douglas R. (1979). Gödel, Escher, Bach. New York: Basic Books. pp. 400–2. ISBN 0-465-02685-0.
  7. Guy, Richard K. (2004). ""E17: Permutation Sequences"". Unsolved problems in number theory (第3版). Springer-Verlag. pp. 336–7. ISBN 0-387-20860-7. Zbl 1058.11001.
  8. Guy, R. K. (1983). "Don't try to solve these problems". Amer. Math. Monthly. 90 (1): 35–41. doi:10.2307/2975688. JSTOR 2975688. By this Erdos means that there aren't powerful tools for manipulating such objects.
  9. Lagarias, Jeffrey C., 編 (2010). The Ultimate Challenge: the 3x + 1 problem. American Mathematical Society. ISBN 978-0-8218-4940-8. Zbl 1253.11003.