LochNess

421 days ago by timgluz

''' #Mathematical walk in nature Q.16 Loch Ness - how long to empty it? Loch Ness is legendary lake in Scotland, someone said mysterious monster lives there. How many times would a single one-gallon bucket need to filled to emtpy that lake and thus expose the mysterious monster? Loch Ness volume is approximately 7.45×10^9 cubic meters( for americans, its ~2 cubic miles), thats approx. 15x volume of water in Sidney harbour! That's huge.(http://www.wolframalpha.com/input/?i=loch+ness) ''' 
       
bucket_volume = 3.785 #liter lake_volume = 7.45 * 10^(9+3) #liters operations = 300 #bitbuckets per hour operators = 1 #how many years it takes? duration = (lake_volume)/(bucket_volume * operations * operators) print duration /( 24*365), " years" print "but lets use more operators, by example population on earth:" print duration / (6 * 10**9), "years" 
       
748971.044477821  years
but lets use more operators, by example population on earth:
1.09349772493762 years
748971.044477821  years
but lets use more operators, by example population on earth:
1.09349772493762 years
 
       
That will take a while... 
That will take a while... 
 
       
Traceback (click to the left of this block for traceback)
...
NameError: name 'duration' is not defined
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_2.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("I2J1dCBsZXRzIHVzZSBtb3JlIG9wZXJhdG9ycywgYnkgZXhhbXBsZSBwb3B1bGF0aW9uIG9uIGVhcnRoCnByaW50IGR1cmF0aW9uIC8gKDYgKiAxMCoqOSksICJ5ZWFycyI="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpYgYc_w/___code___.py", line 3, in <module>
    exec compile(u'print duration / (_sage_const_6  * _sage_const_10 **_sage_const_9 ), "years"
  File "", line 1, in <module>
    
NameError: name 'duration' is not defined