Some probability problems in mathematics and program design

Source: Internet
Author: User

Ep_1

Two coins have been thrown,1> two positive upward probability,2> a positive upward, a negative upward probability

So_1

Enumeration is considered because of the low number of cases: (1 positive 0 anti) 11 10 01 00

1> ANS=1/4 2> ANS=2/4=1/2

Ep_1-Variable

throw n coins,1> n the probability of positive upward,2> x positive upward, (n-x) The probability of the reverse upward

So_1-Variable

1> ans=1/(2^n), apparently.

2> the probability of the positive upward of the continuous X is 1/(2^x), the same (n-x) the probability of a continuous negative upward of 1/(2^ (N-x)), and then consider the statistics of these cases into N boxes, then the X-positive case can be C (n,x) seed, each also corresponds to one ( N-x) The reverse upward method, so there is a total

Ans=c (n,x) *1/(2^x) *1/(2^ (n-x)) =c (n,x)/(2^n)

Ep_2

100 products, 95 pieces of qualified products &5 pieces of unqualified products, from which two pieces are taken.

1> two-piece probability of eligibility

2> the probability that two pieces are not qualified

3> a qualified, one unqualified probability

So_2

We can think of, two pieces of qualified equivalent directly in the selection of two pieces.

The total number of scenarios is: C (100,2). The number of options selected for the qualifying two is: C (95,2).

So, the same idea can solve the following few small questions.

1>ans=c (95,2)/C (100,2)

2>ans=c (5,2)/C (100,2)

3>ans=c (95,1) *c (5,1)/C (100,2)

ep_2-Variable

The bag has n blue ball, M red ball, take K ball out of bag, ask to touch x blue ball probability.

So_2-Variable

Ans=c (n,x) *c (m,k-x)/C (N+M,X)

Ep_3

The password for the Wza bank is 6 digits and the number on each digit is 0 ... 9 of these 10 numbers. Wza forgot his exact password.

1>wza randomly press a set of 6-digit password, exactly what is the probability of the right?

2> if Wza remembers that his password was only one-to-one, what is the probability that he would press the password correctly?

3> if Wza remembers that his password had a 1, 2 2, and 3 3, what was the probability that he would press the correct password once?

So_3

1> because the total number of possible passwords is 10^6 (10 possible per bit), so ans=1/(6^10)

2> possible totals into 3^6,ans=1/(3^6)

3> has a 1, this 1 can be placed in any of the 6 positions, there are C (6,1) method, there are 2 2, minus just put 1, there are 5 positions, there are C (5,2) method, then 3 3, and three positions, there are C (3,3) method, a total of C (6,1) *c (5,2) * C (3,3) = 60 possible.

so ANS=1/60.

Ep_4

A total of 40 pens, 30 black pens, 10 red pens, remove any 4, of which at least 1 is the Red pen is the probability of what?

So_4

Method One: At least one red pen, there may be 1,2,3,4 only Red pen, Ans=c (10,1) *c (30,3)/C (40,4) +c (10,2) *c (30,2)/C (40,4) +c (10,3) *c (30,1)/C (40,4) +c (10,4) * C (30,0)/C (40,4)

Method Two: At least one red pen, it is impossible to have 4 black pens, ans=1-c (30,4) *c (10,0)/C (40,4)

The above two kinds of calculation are the same.

Ep_5

Zyj & Wzh Two players, the probability of free throws is 60%&50%, and now the two are free throws.

1> the probability that both men will hit

The probability of 2> only one human being.

3> the probability of at least one human being

So_5

1>p (AB) =p (a) *p (b) =30%

2> equals Zyj in the probability of &wzh not in the +zyj not &wzh in the probability =60%*50%+50%*40%=50%

3> method One: If the direct calculation to enumerate (ZYJ,ZYJ&WZH,WZH) three cases ....

Method Two: 1-two are not in the probability of =1-40%*50%=80%

Method Three: Add the answers to the above two questions =80%

Ep_6

Zyj shot hit rate is 60%, now he throws 5 times, ask him to hit four times and above probability.

So_6

Ans=p (4 times) +p (5 times) =c (5,4) * (0.6) ^4* (1-0.6) +c (5,5) * (0.6) ^5=0.34

Ep_7

Throw a dice, the probability of appearing 1,2,3,4,5,6 is 1/6, throw 10 times in a row, the sum of 30 points is the probability of how much?

So_7

Do you find it hard to do? We enumerate 10 possible cases, a total of 6^10 species, each of which has a combined sum, a total of possible and from 10 to 60 are distributed.

So we may as well consider the possible and the occurrence of the number of times, how to consider it?

The ingenious use of the polynomial s= (x+x^2+x^3+x^4+x^5+x^6) indicates that this time the number of points that may occur is 1,2,3,4,5,6 (the exponent of x represents a number of points, and the coefficients in front of x indicate several times), then all cases are included in the s^10.

Calculating the coefficients of the x^30 in the (x+x^2+x^3+x^4+x^5+x^6) ^10 equals the total number of possible points and 30 (because each multiplication is equivalent to the addition of the exponent).

How to figure out the coefficient of index 30?

(x+x^2+x^3+x^4+x^5+x^6) ^10

= x^10* (1+x+x^2+x^3+x^4+x^5) ^10

= x^10* ((1-x^6)/(1-x)) ^10

= then unfold the back .... All kinds of Orz turned out of the great God, remember the message tell me how to become this

=x^10*sigma (i=0...10) ( -1) ^i*c (10,i) *x^ (6*i) *sigma (i=0: Positive infinity) C (10-1+i) *x^i

So before there is x^10, back also need x^20, so the first i=0 or 1 or 2 or 3, the back of I corresponding to take 20,14,8,2, you can make up 20 times Square

C (10,0) *c (29,20)-C (10,1) *c (23,14) +c (10,2) *c (17,8)-C (11,2) *c (10,3) =2930455

So the probability ans=2930455/6^10

Ep_8

Randomly generate 3 positive integers in a certain range, so that they can form the probability of a triangle?

So_8

ANS=1/2.

Can you figure out why? First assume that a<=b<=c;

Making a triangle requires a+b>c---a/c+b/c>1,a/c and b/c to be two real numbers in (0,1], and to set X=A/C,Y=B/C, then (x, y) in a square of size 1 in the first quadrant.

Make a straight line x+y=1, then this straight line divides the square into two parts evenly. Fall in the line above is satisfied, the line below is not satisfied, so the probability is 1/2.

Some probability problems in mathematics and program design

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.