3. R programming: Suppose we have two separate bags of balls. Bag A has N number...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. R programming: Suppose we have two separate bags of balls. Bag A has N number of balls in it, some white some black but we don't know how many of each color. Bag B has K white ball(s) and K, black ball(s). You draw R number of balls from Bag A and move them to Bag B. Then, you draw T balls sequentially from Bag B. Suppose the sequence of the these balls turns out to be [S₁, S2,..., ST]. We are interested in the composition of balls in Bag A. List your hypotheses and count up all the ways the observed data can happen. Which hypothesis would you believe more? [30 points] (a) Write a code to to calculate the number of ways the observed sequence [S₁, S2,..., ST] can happen for each hypothesis. Your function should work for any value of N, Kw, K, R, T and for any sequence of balls [S1, S2,..., ST]. [R coding only] [20 points] (b) Which hypothesis is most likely when N = 20, Kw = 10, K = 10, R = 5 and the observed sequence is [W, B, B, W, B, W]. [10 points] 3. R programming: Suppose we have two separate bags of balls. Bag A has N number of balls in it, some white some black but we don't know how many of each color. Bag B has K white ball(s) and K, black ball(s). You draw R number of balls from Bag A and move them to Bag B. Then, you draw T balls sequentially from Bag B. Suppose the sequence of the these balls turns out to be [S₁, S2,..., ST]. We are interested in the composition of balls in Bag A. List your hypotheses and count up all the ways the observed data can happen. Which hypothesis would you believe more? [30 points] (a) Write a code to to calculate the number of ways the observed sequence [S₁, S2,..., ST] can happen for each hypothesis. Your function should work for any value of N, Kw, K, R, T and for any sequence of balls [S1, S2,..., ST]. [R coding only] [20 points] (b) Which hypothesis is most likely when N = 20, Kw = 10, K = 10, R = 5 and the observed sequence is [W, B, B, W, B, W]. [10 points]
Expert Answer:
Related Book For
Computer Networking A Top-Down Approach
ISBN: 978-0136079675
5th edition
Authors: James F. Kurose, Keith W. Ross
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
On 1 June 1998, Alice bought a house in Derby for 45,000. - She occupied the house as her PPR until 1 May 2000 when she left to work in Exeter, living in rented accommodation. - She returned to the...
-
It is desired to enrich the partial pressure of hydrogen in a hydrogen-nitrogen gas mixture for which the partial pressures of both gases are 0.1013 MPa (1 atm). It has been proposed to accomplish...
-
What is the purpose of a decision table? How might decision tables be useful to accountants?
-
A proton is accelerated through a potential difference of \(120 \mathrm{~V}\), as shown in Figure P27.55, and fired into a chamber. There is no electric field in the chamber, but there is a...
-
Use Solver to determine the weights for a four-period weighted moving average on the data set that minimizes the MSE. a. What are the optimal values for the weights? b. Prepare a line graph comparing...
-
For this exercise, instead of using the values in the challenge, ask the user for the number of shares, the share price, and the percent commission.For this exercise, instead of using the values in...
-
Erica and Bob participate in a friendly Hackathon that allows each to solve one question a day out of the three offered. There will be one easy, one medium and one hard question, with points awarded...
-
draw a graph depicting the MR, MC and demand curves for the monopolist. label the profit-maximizing quantity of output and the price the monopolist will charge
-
Assume a companys beginning work in process consists of 20,000 units, 60% complete. Materials are added at the beginning of the process. During the month, 90,000 units are transferred in. The ending...
-
A stock Q is expected to pay a dividend of $6.20 annually in perpetuity. The stock has a beta of 1.20, the risk-free rate is 4.0%, and the market risk premium is 7.5%. 4 pts a What would you expect...
-
Efficient documentation impacts a company audit in which way? Explain briefly also took some example of efficient documentations.
-
3. A baseball of mass 0.25kg is dropped from a height of 2.0m. It bounces from the concrete below and returns to a final height of 1.0m. Neglect air resistance. If the baseball was in contact with...
-
The following Statements of Comprehensive Income relate to Rooster plc (Rooster) and its investee companies, Houseton plc (Houseton) and Kelson plc (Kelson). Kelson is based in New Jersey, USA. It...
-
What do you think?
-
Suppose Client A initiates a Telnet session with Server S. At about the same time, Client B also initiates a Telnet session with Server S. Provide possible source and destination port numbers for a....
-
Consider a broadcast channel with N nodes and a transmission rate of R bps. Suppose the broadcast channel uses polling (with an additional polling node) for multiple access. Suppose the amount of...
-
Suppose Alice and Bob share two secret keys: an authentication key S1 and a symmetric encryption key S2 Augment Figure 8.9 so that both integrity and confidentiality are provided.
-
One of the disadvantages of the IEEET1 exciter is following a fault the terminal voltage does not necessarily return to its prefault value. Using PowerWorld Simulator case Problem 12_3 determine the...
-
Obtain a copy of the ACAS Code of Practice 1: Disciplinary and Grievance Procedures (2009). Use this, and our suggestions in this chapter, to rewrite or modify either of the procedures you used for...
-
Rework Example 13.6 if the source impedance at the sending end of line \(\mathrm{A}\) is \(\mathrm{Z}_{\mathrm{G}}=\mathrm{Z}_{\mathrm{A}} / 4=100 \Omega\), and the receiving end of line...
Study smarter with the SolutionInn App