Bitcoin Forum
May 05, 2024, 04:19:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Dice Games - Provably Fair - ELI5 please?  (Read 172 times)
whohackedme (OP)
Jr. Member
*
Offline Offline

Activity: 43
Merit: 4


View Profile
February 11, 2021, 04:35:10 PM
 #21

I think I finally understand.  It only takes one flip to get halfway there.  You only need one more flip to get 2 in a row, you have a 50/50 chance, so on average it will take both of those flips to get 2 in a row = 3 flips.
This is correct.

So the equation is 2^n  -1  like you said.  (It would be 4 if we wanted specific Heads or Tails in a row, 3 if we do not care which one)  Thanks!
It would actually be 6 if we wanted specifically 2 heads in a row. I'll try to explain why below.

Let the number of flips required to get 2 heads in a row be x. On any single flip, we have a probability of 0.5 of flipping heads, and a probability of 0.5 of flipping tails.

If we flip tails on the first flip, then we still need to flip x more times to get 2 heads, but we have already flipped once, so it becomes (x+1). Since the probability of this is 0.5, it becomes 0.5(x+1).
If we flip heads on the first flip and then tails on the second flip, again we are back where we started needing to flip x more times to get 2 heads, but we already flipped twice, so it becomes (x+2). The probability of flipping a heads then a tails is 0.25, so it becomes 0.25(x+2).
If we flip heads on the first flip and then heads on the second flip, we have succeeded. We have flipped twice, with a probability of 0.25, which becomes (0.25)2.

So, of all the possible outcomes:

x = 0.5(x+1) + 0.25(x+2) + (0.25)2
x = 0.5x + 0.5 + 0.25x + 0.5 + 0.5
x = 0.75x + 1.5
0.25x = 1.5
x = 6


lol, Now I am confused again.

I played that out, I understand 6 is all the possible combinations.  But, in our "playing" case I think it is 4.  IF we want 2 heads in a row, after our 1st flip is Tails, there is zero chance to get 2 heads in a row on next flip so we do not make those two additional plays.  6-2 =4. 
1714925994
Hero Member
*
Offline Offline

Posts: 1714925994

View Profile Personal Message (Offline)

Ignore
1714925994
Reply with quote  #2

1714925994
Report to moderator
1714925994
Hero Member
*
Offline Offline

Posts: 1714925994

View Profile Personal Message (Offline)

Ignore
1714925994
Reply with quote  #2

1714925994
Report to moderator
1714925994
Hero Member
*
Offline Offline

Posts: 1714925994

View Profile Personal Message (Offline)

Ignore
1714925994
Reply with quote  #2

1714925994
Report to moderator
Whoever mines the block which ends up containing your transaction will get its fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18509


View Profile
February 11, 2021, 08:43:44 PM
 #22

IF we want 2 heads in a row, after our 1st flip is Tails, there is zero chance to get 2 heads in a row on next flip so we do not make those two additional plays.  6-2 =4.
But you need to make those additional plays to have any chance to get 2 heads in a row. If you flip a tails and then just give up and do not make any more additional flips, then your chance of getting 2 heads in a row is zero.

If after our first flip is tails, then we have to go back to the start having already flipped once.
If our second flip is tails, then we have to go back to the start having already flipped twice, regardless of what the first flip was.

If you look at all possible combinations of 4 flips:
Code:
TTTT
TTTH
TTHT
TTHH
THTT
THTH
THHT
THHH

HHHH
HHHT
HHTH
HHTT
HTHH
HTHT
HTTH
HTTT

You will see that only half of them contain at least 2 consecutive heads. If you want a 50% chance of getting two consecutive heads, then you flip 4 times. Statistically speaking, if you want two consecutive heads in a row then you need to flip 6 times.
whohackedme (OP)
Jr. Member
*
Offline Offline

Activity: 43
Merit: 4


View Profile
February 12, 2021, 02:37:39 PM
 #23

Makes sense, Thank you.  Not sure why calculus is easier for me than seeing these statistics.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18509


View Profile
February 13, 2021, 09:17:57 AM
 #24

Makes sense, Thank you.  Not sure why calculus is easier for me than seeing these statistics.
No problem, happy to help. I wouldn't worry about it too much, it's not the most intuitive thing to grasp.

Still, it doesn't make much difference to your initial question, which was proving provable fairness. Provided you have the relevant seeds, hashes, and nonces, and you know the process the site in question is using to turn those in to your roll/flip/outcome/whatever, then you can put all the numbers through the same process and check the results are the same. Whether you get 20 wins in a row or 20 losses in a row, or whether you get the "expected" number of wins/losses in x games, is more or less irrelevant, provided you can prove that all those wins/losses were calculated in a provably fair way.
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!