戒賭美沙酮

7月29日 星期三 晴

去了特記超市,1萬1千4百步。

不想賭得太多,有時看別人賭,也可以止一下咳。我比較喜歡看Degen Dalt的片,他應該是真的賭,不像某些Youtuber,明顯是擺拍。


不過13連勝也真是好誇張。我自己印像中最多是11連勝。(還要是賭注好細的時候發生)

但機率其實並不是像他的標題的小(0.0.00148%)。

定義 P(m, n) 為在n局中有最少一次m連勝的機率。方便起見,假設贏的機率是50%。原來都幾難計,於是又問Gemini,將問題簡化成一半機會贏的賽局:


what is recursive formula the probability to get m consecutive heads in n coin flips?


To find the probability of getting (m) consecutive heads in (n) coin flips, the easiest approach is to calculate the number of sequences that do not contain (m) consecutive heads, and then subtract that from the total possible outcomes.
The Recursive Formula
Let (F(n, m)) be the number of flip sequences of length (n) that contain no streak of (m) consecutive heads.
The recurrence relation is defined as:

Base Cases
To run this recurrence, you need the following initial conditions based on the length of (n):
  • For (n < m): (F(n, m) = 2^n) (A streak of length (m) is impossible, so all sequences are valid).
  • For (n = m): (F(m, m) = 2^m - 1) (Every sequence is valid except the single sequence of all heads).
Final Probability Calculation
Once you find (F(n, m)), the probability (P) of getting at least (m) consecutive heads is:

Why this works
The formula breaks the problem down by looking at where the first Tail (T) occurs in the sequence:
  • If the first flip is T, the remaining (n-1) flips cannot have the streak ->  F(n-1, m).
  • If the sequence starts with HT, the remaining (n-2) flips cannot have the streak -> F(n-2, m).
  • This pattern continues up to a starting streak of (m-1) Heads followed by a Tail, leaving (n-m) flips.
If you want, I can:
  • Show you how to manually step through this formula for a small example like .
  • Translate this formula into a clean Python function you can copy and paste.
  • Show you the direct probability recurrence (using fractions instead of total sequence counts).
Let me know how you would like to explore this!
Gemini 還有Python Code 提供:
def F(n, m):
    if n < m:
        return 2**n
    if n == m:
        return 2**m - 1
    return sum(F(n - i, m) for i in range(1, m + 1))

結論是玩得足夠多局,也不是不可能:

100 flips, 13 consecutive heads: 0.00542 200 flips, 13 consecutive heads: 0.01148 300 flips, 13 consecutive heads: 0.01750 400 flips, 13 consecutive heads: 0.02348 500 flips, 13 consecutive heads: 0.02943
11連勝的話,我成世人試過兩次,應該都算合理:
100 flips, 11 consecutive heads:  0.02203
200 flips, 11 consecutive heads:  0.04568
300 flips, 11 consecutive heads:  0.06876
400 flips, 11 consecutive heads:  0.09129
500 flips, 11 consecutive heads:  0.11326
上個月在Palm Beach打出了8連勝,其實玩了二百幾局的話,都應該有1/3機會做到:
100 flips, 8 consecutive heads:  0.17021
200 flips, 8 consecutive heads:  0.31970
300 flips, 8 consecutive heads:  0.44226
400 flips, 8 consecutive heads:  0.54274
500 flips, 8 consecutive heads:  0.62511

Comments

Popular posts from this blog

倫敦廻轉壽司

今日做李嘉誠

豐臣兄弟!

到戲院看戲

五十肩治療記(1)