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 Kw 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 [S1, 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? (a) Write a code to to calculate the number of ways the observed sequence [S1, S2, . .. , ST] can happen for each hypothesis. Your function should work for any value of N, Kw, Kb, R, T and for any sequence of balls [S1, S2,.. . , ST]. [R coding only] (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].

Big Ideas Math A Bridge To Success Algebra 1: Student Edition 2015
1st Edition
ISBN:9781680331141
Author:HOUGHTON MIFFLIN HARCOURT
Publisher:HOUGHTON MIFFLIN HARCOURT
Chapter6: Exponential Functions And Sequences
Section: Chapter Questions
Problem 5CA
icon
Related questions
Question

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 Kw white ball(s) and Kb 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 [S1; 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?
(a) Write a code to to calculate the number of ways the observed sequence [S1; S2; : : : ; ST ]
can happen for each hypothesis. Your function should work for any value of
N;Kw;Kb;R; T and for any sequence of balls [S1; S2; : : : ; ST ]. [R coding only]
(b) Which hypothesis is most likely when N = 20;Kw = 10;Kb = 10;R = 5 and the
observed sequence is [W;B;B;W;B;W].

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 Kw 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 [S1, 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?
(a) Write a code to to calculate the number of ways the observed sequence [S1, S2,..., ST]
can happen for each hypothesis. Your function should work for any value of
N, Kw, Kb, R, T and for any sequence of balls [S1, S2, ... , ST]. [R coding only]
20, Кw
(b) Which hypothesis is most likely when N
observed sequence is [W, B, B, W, B, W].
10, Ki = 10, R = 5 and the
||
Transcribed Image Text: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 Kw 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 [S1, 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? (a) Write a code to to calculate the number of ways the observed sequence [S1, S2,..., ST] can happen for each hypothesis. Your function should work for any value of N, Kw, Kb, R, T and for any sequence of balls [S1, S2, ... , ST]. [R coding only] 20, Кw (b) Which hypothesis is most likely when N observed sequence is [W, B, B, W, B, W]. 10, Ki = 10, R = 5 and the ||
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Big Ideas Math A Bridge To Success Algebra 1: Stu…
Big Ideas Math A Bridge To Success Algebra 1: Stu…
Algebra
ISBN:
9781680331141
Author:
HOUGHTON MIFFLIN HARCOURT
Publisher:
Houghton Mifflin Harcourt
College Algebra (MindTap Course List)
College Algebra (MindTap Course List)
Algebra
ISBN:
9781305652231
Author:
R. David Gustafson, Jeff Hughes
Publisher:
Cengage Learning
Holt Mcdougal Larson Pre-algebra: Student Edition…
Holt Mcdougal Larson Pre-algebra: Student Edition…
Algebra
ISBN:
9780547587776
Author:
HOLT MCDOUGAL
Publisher:
HOLT MCDOUGAL
Algebra: Structure And Method, Book 1
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell
College Algebra
College Algebra
Algebra
ISBN:
9781337282291
Author:
Ron Larson
Publisher:
Cengage Learning
Glencoe Algebra 1, Student Edition, 9780079039897…
Glencoe Algebra 1, Student Edition, 9780079039897…
Algebra
ISBN:
9780079039897
Author:
Carter
Publisher:
McGraw Hill