Open dmytsv opened 4 years ago
Script output:
For a distance 1 there're 1.0 paths containing 1.0 jumps. Expected - 1.0.
For a distance 2 there're 2.0 paths containing 3.0 jumps. Expected - 1.5.
For a distance 3 there're 4.0 paths containing 8.0 jumps. Expected - 1.8333333333333333.
For a distance 4 there're 8.0 paths containing 20.0 jumps. Expected - 2.083333333333333.
For a distance 5 there're 16.0 paths containing 48.0 jumps. Expected - 2.283333333333333.
For a distance 6 there're 32.0 paths containing 112.0 jumps. Expected - 2.4499999999999997.
For a distance 7 there're 64.0 paths containing 256.0 jumps. Expected - 2.5928571428571425.
For a distance 8 there're 128.0 paths containing 576.0 jumps. Expected - 2.7178571428571425.
For a distance 9 there're 256.0 paths containing 1280.0 jumps. Expected - 2.8289682539682537.
For a distance 10 there're 512.0 paths containing 2816.0 jumps. Expected - 2.9289682539682538.
For a distance 11 there're 1024.0 paths containing 6144.0 jumps. Expected - 3.019877344877345.
For a distance 12 there're 2048.0 paths containing 13312.0 jumps. Expected - 3.103210678210678.
For a distance 13 there're 4096.0 paths containing 28672.0 jumps. Expected - 3.180133755133755.
For a distance 14 there're 8192.0 paths containing 61440.0 jumps. Expected - 3.251562326562327.
For a distance 15 there're 16384.0 paths containing 131072.0 jumps. Expected - 3.318228993228993.
For a distance 16 there're 32768.0 paths containing 278528.0 jumps. Expected - 3.380728993228993.
For a distance 17 there're 65536.0 paths containing 589824.0 jumps. Expected - 3.439552522640758.
For a distance 18 there're 131072.0 paths containing 1245184.0 jumps. Expected - 3.495108078196313.
For a distance 19 there're 262144.0 paths containing 2621440.0 jumps. Expected - 3.5477396571436817.
For a distance 20 there're 524288.0 paths containing 5505024.0 jumps. Expected - 3.5977396571436815.
For a distance 21 there're 1048576.0 paths containing 11534336.0 jumps. Expected - 3.6453587047627294.
For a distance 22 there're 2097152.0 paths containing 24117248.0 jumps. Expected - 3.6908132502172744.
For a distance 23 there're 4194304.0 paths containing 50331648.0 jumps. Expected - 3.73429151108684.
For a distance 24 there're 8388608.0 paths containing 104857600.0 jumps. Expected - 3.7759581777535076.
For a distance 25 there're 16777216.0 paths containing 218103808.0 jumps. Expected - 3.8159581777535063.
For a distance 26 there're 33554432.0 paths containing 452984832.0 jumps. Expected - 3.854419716215046.
For a distance 27 there're 67108864.0 paths containing 939524096.0 jumps. Expected - 3.8914567532520827.
For a distance 28 there're 134217728.0 paths containing 1946157056.0 jumps. Expected - 3.927171038966368.
For a distance 29 there're 268435456.0 paths containing 4026531840.0 jumps. Expected - 3.961653797587058.
For a distance 30 there're 536870912.0 paths containing 8321499136.0 jumps. Expected - 3.994987130920392.
For a distance 31 there're 1073741824.0 paths containing 17179869184.0 jumps. Expected - 4.02724519543652.
Added script to calculate number of expected jumps for any distance. 😎
For 10 jumps expected is 2.929 with 512.0 possible variations containing 2816.0 jumps. 🐸
The equation is -> expected_jumps = (distance + 1) / 2 <-This works up to a distance of 498, on 499 my computer crashes. 🖥💥Added probability and now I have no idea what the equation is 🤷♂️ Also with probability added script is not memorizable so it is harder run it for big numbers
PS. I'm not 100% sure about the equation for expected jumps as this is not programming but probability theory. If you can point out the correct way of calculating it please do comment.