Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Gol on February 26, 2014, 09:39:36 AM



Title: output hash value to begin with 10 zeroes : average number of tries?
Post by: Gol on February 26, 2014, 09:39:36 AM
Hello all,
is there a way to calculate the average number of tries(proof of work) for
output hash value to begin with 10 zeroes?

thank you!
Gol


Title: Re: output hash value to begin with 10 zeroes : average number of tries?
Post by: imrehg on February 26, 2014, 12:07:06 PM
In binary format, for every bit that you require in the front to be zero you have 1/2 chance, so if you want to have n bits to be zero, then it's 1/2**n chance (or on average 2**n tries).

If you want the beginning of the the hash in hex representation to be 0: every hex character is actually 4 bits, so for m digits, you'll need 2**(m*4) tries. For 10 zeros in the front it is 2**(10*4) = 2**(40) = 1099511627776 ~ approx 1.1 Trillion tries.


Title: Re: output hash value to begin with 10 zeroes : average number of tries?
Post by: Gol on February 26, 2014, 02:06:59 PM
WOW, thanks!


Title: Re: output hash value to begin with 10 zeroes : average number of tries?
Post by: kjj on February 26, 2014, 05:39:17 PM
More directly, you can see that hex is base 16, so 1610 = 1,099,511,627,776


Title: Re: output hash value to begin with 10 zeroes : average number of tries?
Post by: luv2drnkbr on February 26, 2014, 07:16:02 PM
each byte is two characters, so 10 zeros is actually five 00 bytes.  one byte has 256 possible combinations, so assuming that each combo is just as probable as any other combo, the probability is (1/256) * (1/256) * (1/256) * (1/256) * (1/256) = 1/1099511627776