Etc
연금복권520의 기대 값
steloflute
2013. 7. 6. 21:44
연금복권520의 기대 값(expected value): 725.56원
In Racket:
> (exact->inexact (+ (* 5000000 12 20 1/3150000) (* 100000000 1/1575000) (* 10000000 1/900000) (* 1000000 1/100000) (* 20000 1/1000) (* 2000 1/50) (* 1000 1/5)))
725.5555555555555
In Parenjs:
(+ (* 5000000 12 20 1/3150000) (* 100000000 1/1575000) (* 10000000 1/900000) (* 1000000 1/100000) (* 20000 1/1000) (* 2000 1/50) (* 1000 1/5))
725.5555555555555
In JavaScript:
5000000*12*20/3150000 + 100000000/1575000 + 10000000/900000 + 1000000/100000 + 20000/1000 + 2000/50 + 1000/5
725.5555555555555
In Common Lisp:
(float (+
(* 5000000 12 20 1/3150000)
(* 100000000 1/1575000)
(* 10000000 1/900000)
(* 1000000 1/100000)
(* 20000 1/1000)
(* 2000 1/50)
(* 1000 1/5)))
725.55554