Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Mathematica Code R : = Module [ { u , runs } , ( * module to return a RV for the number of runs

Mathematica Code
R := Module[{u, runs},
(* module to return a RV for the number of runs earned by a team in \
one inning, cf. Glass & Lowry paper *)
u = U;
runs = Which[u <0.73,0, u <0.878,1, u <0.946,2, u <0.977,3,
u <0.991,4, u <0.997,5, u <=1,6];
Return[runs];
]
game := Module[{},
(* initialize variables *)
inning =1;
runsA =0;
runsB =0;
scoreA ={};
scoreB ={};
totalA =0;
totalB =0;
(* run for 9 or more innings, as needed *)
While[(inning <=9)||(inning >9 && totalA == totalB),
(* half inning for team A*)
runsA = R;
AppendTo[scoreA, runsA];
totalA = totalA + runsA;
(* half inning for team A*)
runsB = R;
AppendTo[scoreB, runsB];
totalB = totalB + runsB;
inning +=1;
];
inning -=1; (*
adjust inning counter to end with an accurate value *)
(* Return any info wanted about the game *)
Return[totalA];
]
Bade on this Mathematica code, write code for this problem
[How likely is it to have a game end with a combined score above 20 runs?]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Name the PivotTable Total Book Sales.

Answered: 1 week ago