Question: Write a Python function likelihood taking die, an integer 1 giving the number of sides ofthe die, and roll, an integer 1 giving the roll.

Write a Python function likelihood taking die, an integer 1 giving the number of sides ofthe die, and roll, an integer 1 giving the roll. It should return the likelihood Pr(roll die).Hint: It is a very short function (only two or three lines).
b
.
Write a Python function update_with_one_roll taking probs, a list of floating-point hypothesis probabilities [Pr(4), Pr(6), Pr(8)], and roll, an integer from 1 to 8 giving thedie roll. The function should return a floating-point list of the updated probabilities. Hint: Useand include code for the likelihood function (from part a).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!