Now that the Super Bowl is only a memory and there were no responses to the
challenge, maybe this will encourage some reaction. (I liked it better when
2 was a win for the AFL)
b=: 13 :'2+1{."1 I.3=+/\"1 ?2$~y'
]games=:fd b 2000000 6
2 687154
4 249583
5 375485
6 375183
7 312595
]prob=:(2 4 5 6 7),. (1{"1 games)%2000000
2 0.343577
4 0.124792
5 0.187743
6 0.187591
7 0.156298
]+/(1{"1 games)%2000000
1
]td=: fd (6*2=y)+ y=:, 2+1{."1 I.3=+/\"1 #:i.64
4 8
5 12
6 12
7 10
8 22
]tpd=:(4+i.5),. ({:"1 td) %+/{:"1 td
4 0.125
5 0.1875
6 0.1875
7 0.15625
8 0.34375
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Tuesday, January 31, 2012 4:46 AM
To: [email protected]
Subject: [Jprogramming] Challenge 5 Super Bowl Supposition
Challenge 5 Super Bowl Supposition PLEASE DO NOT RESPOND UNTIL 2/6/2012 12
am EST
As the Super Bowl approaches, suppose it will be decided like baseball. Four
of seven games determines a winner. Also suppose that the NFL has won the
first game.
Simulate results of 2000000 series and provide the number of times the NFL
wins in 4 5 6 7 games. If the AFL wins this Extended Super Bowl
Contest, the result is an 8 . Create a 2000000 item list of number of
games necessary to determine a winner and provide a frequency distribution.
fd=: [: /:~ ({. , #)/.~
fd (expression for 2000000 trials)
4 249561
5 374865
6 373851
7 312603
8 689120
]games=:fd n,.2000000$6
4 249301
5 376266
6 375281
7 311189
8 687963
]prob=:(4+i.5),. (1{"1 games)%2000000
4 0.124651
5 0.188133
6 0.18764
7 0.155595
8 0.343982
]+/(1{"1 games)%2000000
1
Now, confirm that your results are reasonable with a theoretical argument.
Also, enjoy the Super Bowl!
Linda
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm