To get an idea of how big 2×1031 is, suppose it were possible to execute the body of the while loop in 1 nanosecond. There are 109 nanoseconds in a second, which means it would take
2×1031 values / 109 values/sec = 2×1022 secto seach through all values (which is the worst case). There are roughly 31×106 seconds in a year, giving
3×1022 sec / 31×106 sec/year = 6.4×1014 yearsto search through all the values. In comparison, the universe is believed to be between 10 and 20 billion years old.
This page last modified on 24 January 2006.