Several probability questions

Source: Internet
Author: User

Original: http://www.cnblogs.com/orchid/p/4067042.html

1, a stick, cut into three sections, the probability of the formation of a triangle is how much?

2, throw a six-side dice, continuous throw until 6, ask how many times you want to throw?

3, a wooden barrel inside a m white ball, every minute from the bucket randomly take out a ball painted red (whether white or red are red) and then put back, ask the bucket of the ball all the expected time to paint red?

4, you have a sword. With each gem used, a 50% probability of success will make the sword ascend one level, and the probability of 50% will fail. If the sword's progression is greater than or equal to 5, then failure will cause the sword to fall to 1 levels. If the sword's progression is less than 5, failure has no effect. The question is: how many gems can I expect to get a 1-level sword up to level 9?

5, a black box is a diagram, the structure is unknown, only know the number of points is N, the number of sides is m, write the formula gives two points connected probability.

6, 54 cards, evenly divided into three piles, the size of the king in the same heap probability?

Solutions:

1, 0.25

Assume that the overall length is 1 (since this value does not affect the probability of the calculation, so it can be assumed), the length of the first paragraph is x, the second paragraph is Y, the third paragraph is 1-x-y.

x, y value to be a stick cut out of the length must be satisfied with the conditions for 0<x<1, 0<y<1,0<x+y<1, these points constitute 1 of the red part.

And these three paragraphs to form a triangle must also satisfy:

X+y>1-x-y = x+y>0.5

X+1-x-y>y = y<0.5;

Y+1-x-y>y = x<0.5

These points constitute the yellow area in Figure 2. The ratio of the yellow area to the area of the red area is the ratio of all cuts that can be made to a triangle and all cutting methods. That is the answer to the question.

2, is this a probabilistic model? What's it called?

Because the probability of each throw to 6 is equal, is 1/6, so the expected number of times is 1/(1/6) = 6 times.

3, a wooden barrel inside a m white ball, every minute from the bucket randomly take out a ball painted red (whether white or red are red) and then put back, ask the bucket of the ball all the expected time to paint red?

The same probability model is used in this topic and above.

The 1th number of non-shaded wins expected in M balls is: 1

The 2nd number of non-shaded acquisition times in the M ball is expected to be: 1/(m-1/m)----This is the expectation from the model of topic 2, just like the dice (only two colors), the first coloring point is 1, and all the other non-colored points are 2.

The 3rd number of non-shaded acquisition times in M Balls is expected to be: 1/(m-2/m)

...

The expected number of times required to obtain the M-stained in M-Ball is: 1/(1/m)

The overall number of expectations is 1+ 1/(m-1/m) +1/(m-2/m) +...+m

4,

A[i] represents the number of gems that are expected to be used from level i-1 to Grade I.

When i<=5 is not degraded, the expected quantity is 2, i.e. a[2] = a[3] = a[4] = a[5] = 2

When I>5, because it will be degraded, the success of a gem is enough, the unsuccessful need to reverse the level, need to first use a[i-1] a gem first to return to the i-1 level, and then use A[i] a gem rose to the level I, namely

A[i] = 1 * + (1 + a[i-1] + a[i]) * 1/2

ie a[i] = a[i-1] + 2

A[6]= 4, A[7] = 6, a[8] = 8, a[9] = 10

The number of gems required for levels 1 to 9 is a[2]+...+a[9] = 36.

5, (only my solution, maybe it's not right ...)

n vertices can have n=n* (n-1)/2 edges, so this problem and problem: N experiments, each experiment results in accordance with the Bernoulli distribution, the probability of success is P (unknown), n times the total success (average) number of M, then p is how much? is the same. The random variable A indicates the number of times the success of the n-th-Knoop experiments, the Ai represents the results of the first experiment, P (ai=0) =p, then a=a1+a2+ .... M=e (A) =e (A1) +e (A2) +. 。 and E (Ai) is =p, so it's easy to find p.

6,

In high school, this problem is too much of a vegetable!! It's a pity I've been in high school for over seven or eight years.

Random event A: Xiao Wang and the king in the same heap

Random event Ai: Xiao Wang and king in Heap I, i=1,2,3. A1,A2 and A3 mutexes

P (A) =p (A1+A2+A3) =p (A1) +p (A2) +p (A3) =p (King in first Heap, Xiao Wang in first heap) +p (king in the second heap, Xiao Wang in the second heap) +p (king in the third heap, Xiao Wang in the third heap)

=p (King in the first pile) p (Xiao Wang in the first pile) of the +p (king in the first heap) of the (Kings in the second pile) p (Xiao Wang in the second pile) of the +p (king in the third heap) (Wang in the second pile) p (Xiao Wang in the third pile)

=3* (17/53) * (1/3)

=17/53

----------------------------------------------------------------------------------------------------

1, give you an array, design an efficient and fair way to shuffle this array randomly

2, there is an apple, two people toss a coin to decide who eats this apple, first throws to the front person to eat. What is the probability that you will eat apples first?

3, fast generation of 1 billion non-repeating 18-bit random number algorithm (generate m non-repeating random number from n number)

Solution1:

1, for a[i],i=0,1,2,... N, randomly in array a[i,i+1,.. N] Select a number to Exchange to a[i].

Why do you do this randomly?

To prove that the algorithm is random, only the probability that each number is assigned to each location is equal.

Easy to get, the probability that the array 0-n position any number to position 0 is 1/n

The probability to position 1 is (1-1/n) * (1/(n-1)) =1/n

Explanation: P (to position 1) =p (the first call to the random algorithm is not swapped to position 0) P (second to position 1| when the first call to the random algorithm is not swapped to position 0)

The probability to position 2 is (1-1/n) (1-1/(n-1)) (1/n-2) =1/n

...

2, a means that random events first throw the people to eat apples, then

I mean the number of times the first throw, the above formula can be calculated, P (A) =2/3

3,

Several probability questions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.