Question: Programming in R. There are 2 separate boxes of balls. Box A has N number of balls within it, some white some black but we
Programming in R.
There are 2 separate boxes of balls. Box A has N number of balls within it, some white some black but we dont know how many of each color. Box B has (Kw white balls) and (Kb black balls). We draw R number of balls from Box A and move them to Box B. Then, we draw T balls sequentially from Box B. Suppose the sequence of the these balls turns out to be [J1, J2, . . . , ST ]. We are interested in the composition of balls in BOX A. List your hypotheses and count up all the ways the observed data can happen. Which hypothesis would you believe more?
1.) Write a code in R. to to calculate the number of ways the observed sequence [J1, J2, . . . , ST ] can happen for each hypothesis. The function should work for any value of N, Kw, Kb, R, T and for any sequence of balls [J1, J2, . . . , ST ].
2) What hypothesis is most likely when N = 20, Kw = 10, Kb = 10, R = 5 and the observed sequence is [White, Black, Black, White, Black, White].
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
