Created
June 11, 2009 23:17
-
-
Save burke/128302 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~ % irb1.9 --simple-prompt burke@zaphod (17:35) | |
| >> wd=->(dl){(1/30.0)*((80+dl)/100.0)} | |
| => #<Proc:0x0d3c98@(irb):1 (lambda)> | |
| >> wd.(1) | |
| => 0.027 | |
| >> wd.(5) | |
| => 0.0283333333333333 | |
| >> wd.(40) | |
| => 0.04 | |
| >> wd.(1) | |
| => 0.027 | |
| >> n=1 | |
| => 1 | |
| >> (1..100).each{|m|n*=((2/3.0)**n)} | |
| => 1..100 | |
| >> n | |
| => 0.0236194332235347 | |
| >> n=1 | |
| => 1 | |
| >> (1..100).each{|m|n+=((2/3.0)**n)} | |
| => 1..100 | |
| >> n | |
| => 9.26161646234953 | |
| >> n=1 | |
| => 1 | |
| >> (1..100).each{|m|n+=((2/3.0)**n)} | |
| => 1..100 | |
| >> wdf=->(dl){wd.(dl)*n} | |
| => #<Proc:0x3fc35c@(irb):14 (lambda)> | |
| >> wdf.(1) | |
| => 0.250063644483437 | |
| >> wdf=->(dl){1-((1-wd.(dl))*n)} | |
| => #<Proc:0x3f5aac@(irb):16 (lambda)> | |
| >> wdf.(1) | |
| => -8.01155281786609 | |
| >> | |
| ?> ^C | |
| >> wdf=->(dl){(1-wd.(dl))*n} | |
| => #<Proc:0x3f1aec@(irb):19 (lambda)> | |
| >> wdf.(1) | |
| => 9.01155281786609 | |
| >> wdf=->(dl){(1-wd.(dl))} | |
| => #<Proc:0x3ec72c@(irb):21 (lambda)> | |
| >> wdf.(1) | |
| => 0.973 | |
| >> wdf=->(dl){(1-wd.(dl))*n} | |
| => #<Proc:0x3e3564@(irb):23 (lambda)> | |
| >> wdf.(1) | |
| => 9.01155281786609 | |
| >> wdf=->(dl){(1-wd.(dl))} | |
| => #<Proc:0x3df928@(irb):25 (lambda)> | |
| >> wdf.(1) | |
| => 0.973 | |
| >> 1-_ | |
| => 0.027 | |
| >> wd=->(dl){(1/30.0)*((80+dl)/100.0)} | |
| => #<Proc:0x3d9f28@(irb):28 (lambda)> | |
| >> wd.(1) | |
| => 0.027 | |
| >> 1-_ | |
| => 0.973 | |
| >> wdf=->(dl){(1-wd.(dl))**n} | |
| => #<Proc:0x3d291c@(irb):31 (lambda)> | |
| >> wdf.(1) | |
| => 0.776078559975462 | |
| >> 1-_ | |
| => 0.223921440024538 | |
| >> wdf=->(dl){1-(1-wd.(dl))**n} | |
| => #<Proc:0x3c873c@(irb):34 (lambda)> | |
| >> 1-_ | |
| TypeError: Proc can't be coerced into Fixnum | |
| from (irb):35:in `-' | |
| from (irb):35 | |
| from /opt/local/bin/irb1.9:12:in `<main>' | |
| >> wdf.(1) | |
| => 0.223921440024538 | |
| >> wdf=->(dl){1-(1-wd.(dl))**n} | |
| => #<Proc:0x15354c@(irb):37 (lambda)> | |
| >> wdf.(1) | |
| => 0.223921440024538 | |
| >> wdf.(40) | |
| => 0.314822709853097 | |
| >> wdl=->(dl,rn){wdf.(dl)} | |
| => #<Proc:0x14d00c@(irb):40 (lambda)> | |
| >> nf=->(rn){1-0.9**rn} | |
| => #<Proc:0x0da5d4@(irb):41 (lambda)> | |
| >> nf.(6) | |
| => 0.468559 | |
| >> wdl=->(dl,rn){1-(1-wdf.(dl))**nf.(rn)} | |
| => #<Proc:0x0d4274@(irb):43 (lambda)> | |
| >> wdl.(1,9) | |
| => 0.143833011078348 | |
| >> wdl.(1,8) | |
| => 0.134439003889271 | |
| >> wdl.(1,7) | |
| => 0.123880281481259 | |
| >> wd=->(dl){(1/30.0)*(1-((80+dl)/100.0))} | |
| => #<Proc:0x512e44@(irb):47 (lambda)> | |
| >> wdl.(1,7) | |
| => 0.0302323813722123 | |
| >> wd=->(dl){(1/30.0)*((80+dl)/100.0)} | |
| => #<Proc:0x50c120@(irb):49 (lambda)> | |
| >> wd=->(dl){(1/30.0)*(((1-80+dl))/100.0)} | |
| => #<Proc:0x506d88@(irb):50 (lambda)> | |
| >> wd=->(dl){(1/30.0)*((80+dl)/100.0)} | |
| => #<Proc:0x503138@(irb):51 (lambda)> | |
| >> wd=->(dl){(1/30.0)*(((1-80+dl))/100.0)} | |
| => #<Proc:0x3fe3c8@(irb):52 (lambda)> | |
| >> wdl.(1,7) | |
| => -0.132040524973396 | |
| >> wd=->(dl){(1/30.0)*((80+dl)/100.0)} | |
| => #<Proc:0x3f6e48@(irb):54 (lambda)> | |
| >> wd=->(dl){(1/30.0)*((20-dl)/100.0)} | |
| => #<Proc:0x3f384c@(irb):55 (lambda)> | |
| >> wdl.(1,7) | |
| => 0.0302323813722123 | |
| >> wd=->(dl){(1/30.0)*((80+dl)/100.0)} | |
| => #<Proc:0x3ed578@(irb):57 (lambda)> | |
| >> wdl.(1,7) | |
| => 0.123880281481259 | |
| >> wd=->(dl){(1/30.0)*((20-dl)/100.0)} | |
| => #<Proc:0x3e3424@(irb):59 (lambda)> | |
| >> wdl.(1,7) | |
| => 0.0302323813722123 | |
| >> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment