Knowee
Questions
Features
Study Tools

Don Snow's life is in danger. Sirsea has sentenced him to death. But Don has demanded trial by programming, and he has named you as his champion to solve the following problem :A bag contains N balls indexed from 1 to N, ith of which has radius Ri.One instance of a game is played as follows :A number K is chosen.One ball is picked out from the bag, if this ball has index K, then the game stops, otherwise the game continues.The probability of a ball being picked from the bag is proportional to its radius.Your task is, to find the expected number of balls to be taken out of the bag for every K from 1 to N

Question

Don Snow's life is in danger. Sirsea has sentenced him to death. But Don has demanded trial by programming, and he has named you as his champion to solve the following problem :A bag contains N balls indexed from 1 to N, ith of which has radius Ri.One instance of a game is played as follows :A number K is chosen.One ball is picked out from the bag, if this ball has index K, then the game stops, otherwise the game continues.The probability of a ball being picked from the bag is proportional to its radius.Your task is, to find the expected number of balls to be taken out of the bag for every K from 1 to N

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

This problem can be solved using the concept of expected value in probability. Here are the steps to solve it:

  1. First, calculate the total radius of all balls in the bag. This can be done by summing up all the radii. Let's denote this sum as Total_Radius.

  2. Now, for each ball K from 1 to N, calculate the probability of picking that ball. This can be done by dividing the radius of the ball K by the Total_Radius. Let's denote this probability as P(K).

  3. The expected number of balls to be taken out of the bag for each K can be calculated as the reciprocal of P(K). This is because the expected number of trials to get a success in a geometric distribution is 1/P.

  4. Repeat steps 2 and 3 for each K from 1 to N.

Here is a Python code snippet that implements these steps:

def expected_number_of_balls(N, radii):
    Total_Radius = sum(radii)
    expected_values = []
    for K in range(1, N+1):
        P_K = radii[K-1] / Total_Radius
        expected_values.append(1 / P_K)
    return expected_values

In this function, N is the number of balls and radii is a list of radii of the balls. The function returns a list of expected values for each K from 1 to N.

Remember to use 1-indexing for the balls as per the problem statement.

This problem has been solved

Similar Questions

Ravi has a bag with 8 balls numbered 1 through 8. He is playing a game of chance.This game is this: Ravi chooses one ball from the bag at random. He wins $1 if the number 1 is selected, $2 if the number 2 is selected, $5 if the number 3 is selected, $6 if the number 4 is selected, $8 if the number 5 is selected, and $10 if the number 6 is selected. He loses $14 if 7 or 8 is selected.(If necessary, consult a list of formulas.)(a) Find the expected value of playing the game.dollars(b) What can Ravi expect in the long run, after playing the game many times?(He replaces the ball in the bag each time.)Ravi can expect to gain money.Hecanexpecttowindollarsperselection.Ravi can expect to lose money.Hecanexpecttolosedollarsperselection.Ravi can expect to break even (neither gain nor lose money).

Justin is playing a game of chance in which he rolls a number cube with sides numbered from 1 to 6. The number cube is fair, so a side is rolled at random.This game is this: Justin rolls the number cube once. He wins $1 if a 1 is rolled, $2 if a 2 is rolled, $3 if a 3 is rolled, and $4 if a 4 is rolled. He loses $6.50 if a 5 or 6 is rolled.(If necessary, consult a list of formulas.)(a) Find the expected value of playing the game.dollars(b) What can Justin expect in the long run, after playing the game many times?Justin can expect to gain money.Hecanexpecttowindollarsperroll.Justin can expect to lose money.Hecanexpecttolosedollarsperroll.Justin can expect to break even (neither gain nor lose money).

Suppose we change the game’s rules to the following:Outcome Prize4 red balls +1504 blue balls -150Any other outcome -10What will be the expected value for X (the amount of money won by a player after playing the game once)?-2.5-5+2.5+7.5

A man draws 3 balls from a jug containing 5 white balls and 7 black balls. He gets Rs. 20 for each white ball and Rs. 10 for each black ball. What is his expectation?Rs. 21.25Rs. 42.50Rs. 31.25Rs, 45.21

There is a bag with three balls numbered 1 to 3. There is also a pack of three cards lettered K, Q, and J.As a trial of an experiment, a ball was chosen and a card drawn. The number 1 to 3 of the ball and the letter K, Q, or J of the card drawn were recorded.Here is a summary of the data from 550 trials.Outcome 1K 2K 3K 1Q 2Q 3Q 1J 2J 3JNumber of trials 61 57 64 59 64 57 64 58 66Answer each part.(a) Assuming the ball was chosen and the card was drawn at random, find the theoretical probability of this event: both choosing the 1 or 2 ball and drawing the Q card, in a single trial. Round your answer to the nearest thousandth.(b) Use the data to find the experimental probability of this event: both choosing the 1 or 2 ball and drawing the Q card, in a single trial. Round your answer to the nearest thousandth.(c) Choose the statement that is true.

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.