These problems are a spin-off of ‘Programming Pearls’ by John Bently. If you’d like a copy, please drop me an email at email@example.com!
#4. If you punched the contents of a disk onto cards, how many boxes of punch cards would that be?
Hint #1. A punch card can store 80 bytes and a box has 2000 punch cards.
Or, about 160 kilobytes (1 kilobyte = 1000 bytes)
Hint #2. A disk has about 200 megabytes.
1 megabyte = 1000 kilobytes
Or, a disk is about 200000 / 160 = 1250 boxes of punch cards
#5. This question is specially for our readers who are programmers
A programmer spends one hour of CPU time and one day of his time to speed up a program by ten percent on a machine that costs $100 per hour of CPU time. If the individual runs of the program typically require a minute of CPU time, how long will it take to pay for the speedup if the program is run 100 times a day?
The total investment to run the machine is $100 in CPU time + $400 for the programmer = $500
(Why $400? Find out here)
If 10 minutes are saved due to the speed up,
60 minutes = $100
then, 50 minutes = about $84
or, we save about $16 dollars.
The investment of $500 to speedup the program can be paid off in $500 / $16 = 31.25 days
or, about a month