Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
On Wed, 2 Jul 2003, Mike Miller wrote:
> On Wed, 2 Jul 2003, Mike Miller wrote:
>
> > > So every year I walk students through the Tower of Hanoi Problem with a
> > > small number of disks, establish that the number of moves it takes for
> > > the n disk problem is 2^n - 1, and then ask for people to guess how long
> > > the 64 disk problem takes if you can do 1 move per second.
> >
> > I do it as (2^10)^6 * 2^4 which more than 16*(10^3)^6 = 1.6*10^19 seconds.
> > But how long is that? There are 3600 seconds per hour and 24 hours per
> > day so there are about 8.6*10^5 seconds per day and about 3.7*8.6*10^7 or
> > 3.2*10^8 seconds per year. So that means (1.6/3.2)*10^(19-8) = 5 x 10^10
> > days to solve. That is 50 billion.
>
> And I screwed up at the end. Meant to say 5 x 10^10 *years* to solve, or
> 50 billion years.
Alas, that wasn't your only error. 3600*24 < 10^5. Repeat after me:
there are pi*10^7 seconds in a year, approximately. This is well-worth
remembering both for problems like this, and for times when you get an
answer that says you'll need some non-trivial fraction of a year of CPU
time or the like.
So if 2^64 = 16*10^18 (for exactly the reason you say), the answer
we're looking is 16*10^18 / (# of years in a second) = 5.something * 10^11
years. So you're off by a factor of 10.
> Doing it with a computer, I get 58.4 billion years, which doesn't bother
> me because I knew I was low and I was shooting mostly for the order of
> magnitude.
Well, it bothers me since your computer has slipped a place. :-)
jking
_______________________________________________
discussion mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/discussion