((...snip...))
Another fun math thing. Earlier, someone was trying to figure out if 2^256 was closer to the number of atoms in the universe (or the visible universe, or a fraction of these atoms, or the atoms in a person)
2^256 atoms?
Well, every "mol" of hydrogen atoms weighs 1 gram:
(cite) -- Avogadro constant so aprox: 6.02214 * 10^23
great!
Now for some math & logic time:
(6.02214 * 10^23) = number of hydrogen atoms in 1 liter of hydrogen gas at standard temperature / pressure (ideal gas law)
A liter of water weighs approximately 1000 grams (1 kg)
A single water molecule weighs aprox 18 times as much as a single hydrogen atom
Therefore, 55.5 mols of water in a liter (kilogram)
7.806 * 10^26 atoms in 70 kilograms of water. The human body is mostly water.
Assuming we're mostly water, the human body has aprox 2^70 atoms
2^256 hydrogen atoms ... actually I'm just going to stop right now, converting to decimal and bypassing mass calculations:
log(2^256) / log(10) ... you're already much closer to the number of atoms in the visible universe.
... Not to worry though, since there is no point in attempting to exhaust the 256 keyspace:
Only 160 bits worth of hash used to generate bitcoin's 34 "digit" base 58 public key addresses, so you'll VERY likely have many many collisions well before you try a number of keypairs equal to the number of atoms on planet earth.
... that's what I get for not proofreading sufficiently. NO CLUE where that 2^70 atoms came from. Gonna check my math because I'm suspicious now:
K = 1000 / 18 = 55.55555 (mols of water molecules in 1 kilogram of water)
^ trivial reasoning, so not showing work there.
C = 6.02214 * 10^23 = Atoms in 1 "mol" of anything.
M = K * C = total number of water molecules in a kilogram of water
H = M * 3 * 70 = atoms in a 70 kg human
^water has 3 atoms per molecule, assume 70 KG body mass
(simplified density calculation / calculating with water since humans are mostly water)
ok here we go:
H = M * 3 * 70
(K * C) * 3 * 70
18 * (6.02214 * 10^23) * 3 * 70
10839852000000000000000000 * 3 * 70
H = 2276368920000000000000000000
now to binary:
log(H) / log(2)
62.992379105356328965599428828285 / 0.69314718055994530941723212145818
H = 90.87879...
oops, I'm not sure where I got the earlier value of 2^70
... my bad, but either way, still less than 2^256 atoms in a human
This is why they try to it's common to ask students to show their work / prove everything with math.
Edited:ACK!!! ok, this time I used the wrong value for K, here's fixed math:
H = M * 3 * 70
(K * C) * 3 * 70
55.555... * (6.02214 * 10^23) * 3 * 70
33456333333333333333333333.333333 * 3 * 70
H = 7025830000000000000000000000
now to binary:
log(H) / log(2)
64.119390868546136633237958001732 / 0.69314718055994530941723212145818
H = 2^92.5 (most people only know their weight to about 3 significant digits anyway)