Post
Topic
Board Bitcoin Discussion
Merits 59 from 5 users
Re: [Quiz] Answer the Bitcoin question and earn merits! #1
by
hosseinimr93
on 16/03/2024, 22:15:18 UTC
⭐ Merited by BlackHatCoiner (25) ,vapourminer (20) ,LoyceV (12) ,_act_ (1) ,Zaguru12 (1)
_act_ is right. The probability is 5.11%.

The probability can be calculated using the formula mentioned on page 7 of bitcoin whitepaper.



in which



q is the probability of the the next block being mined by the attacker, p is the probability of the next block being mined by honest nodes and z is the number of confirmations your transactions has received so far.

The C code has been seen on the whitepaper and here is the python code.

Code:
from math import e,factorial

#Enter q and z and then run the program
q=0.3074
z=10

p=1-q
lambda_= z*(q/p)
sum=0
for k in range(z+1):
    sum+=(((lambda_**k)*e**(-lambda_))/factorial(k))*(1-(q/p)**(z-k))
print((1-sum))


The following chart displays how the probability of your transaction being removed from the blockchain decreases with more confirmations.