Question

In: Computer Science

Python CODE for this question: There are 2 red marbles and 98 blue marbles in a...

Python CODE for this question:

There are 2 red marbles and 98 blue marbles in a jar. Draws are made at random with replacement. Find the smallest number of draws needed such that the probability is greater than 1/2 that a red marble is drawn at least once.

Solutions

Expert Solution

Python code for the same :

To use log() function in python, there is a library named math, so I imported that.

I have just written simplified logic described above in python.

import math

n = math.log(0.5)/(math.log(49) - math.log(50))

print(n)

Output :

Like, if this helped :)


Related Solutions

There are 12 blue marbles, and 17 red marbles in a bag. 6 of the marbles...
There are 12 blue marbles, and 17 red marbles in a bag. 6 of the marbles are drawn from the bag without being replaced. N=29 K=17 n=6 P(2 blue, 4 red)? P(5 blue, 1 red)? P(1 blue, 5 red)? Odds against 2 red? E(red)= ? σ(blue)= ? Show work below.
What is the probability of drawing, in order, 2 red, 1 blue, and 2 yellow marbles if a bag contains 4 yellow, 5 red, and 6 blue marbles?
What is the probability of drawing, in order, 2 red, 1 blue, and 2 yellow marbles if a bag contains 4 yellow, 5 red, and 6 blue marbles?
You randomly select 2 marbles from a mug containing 6 blue marbles, 6 red marbles, and...
You randomly select 2 marbles from a mug containing 6 blue marbles, 6 red marbles, and 3 white marbles. How many times greater is the probability of selecting 2 red marbles when you replace the first marble before selecting the second marble than when you do not replace the first marble before selecting the second marble?
Suppose you have a bag containing 2 red marbles, 3 white marbles, and 4 blue marbles....
Suppose you have a bag containing 2 red marbles, 3 white marbles, and 4 blue marbles. a) if you draw 3 marbles simultaneously, what is the probability that you get one of each color? b) If you draw 3 marbles one at a time, what Is the probability that you get one of each color?
In a box, there are 400 blue marbles and 100 red marbles. When 200 marbles are...
In a box, there are 400 blue marbles and 100 red marbles. When 200 marbles are randomly chosen from the box, let the random variable X represent the number of chosen blue marbles. (a) Find P(X ≥ 102). [You may leave the answer in terms of “combinations” or “factorials”.] (b) Find P(X = 160) using binomial approximation
Suppose that a drawer contains 8 marbles: 2 are red, 2 are blue, 2 are green,...
Suppose that a drawer contains 8 marbles: 2 are red, 2 are blue, 2 are green, and 2 are yellow. The marbles are rolling around in a drawer, so that all possibilities are equally likely when they are drawn. Alice chooses 2 marbles without replacement, and then Bob also chooses 2 marbles without replacement. Let Y denote the number of red marbles that Alice gets, and let X denote the number of red marbles that Bob gets. a. Find probability...
An urn has marbles of red, blue, and yellow. There are seven marbles of each of...
An urn has marbles of red, blue, and yellow. There are seven marbles of each of the three colors. The experiment consists of drawing a single, random marble from the urn. Define a random variable X by X(s) = -1 if the marble has red 0, if the marble has blue +1, if the marble has yellow 54 random samples of X are taken. Approximate the probability that the mean of the sample is between 0 and 1/20.
Four marbles are being drawn from an urn containing 8 blue and 2 red marbles. Let...
Four marbles are being drawn from an urn containing 8 blue and 2 red marbles. Let X be the number of blue marbles drawn. What this the probability mass function for X if the marbles are drawn with replacement.
A box contains 5 green marbles, 8 blue marbles, and 8 red marbles. Three marbles are...
A box contains 5 green marbles, 8 blue marbles, and 8 red marbles. Three marbles are selected at random from the box, one at a time, without replacement. Find the probability that the first two marbles selected are not red, and the last marble is red.
13) A box contains 5 green marbles, 6 blue marbles, and 8 red marbles. Three marbles...
13) A box contains 5 green marbles, 6 blue marbles, and 8 red marbles. Three marbles are selected at random from the box, one at a time, without replacement. Find the probability that the first two marbles selected are not red, and the last marble is red. Round your answer to four decimal places.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT