Probability:
Poj 2151
There are t teams and M questions, which give the probability that each team will make each question. Calculate the probability that each team has at least one question and the champion team has at least N questions.
Each team has at least one question. The opposite event is that each team has at most 0 questions. Therefore, we need to find the probability of making 0 questions for each pair.
The opposite event of the champion's probability of making at least N questions is that all teams can make n-1 at most, so we need to record the probability that each team can make X at most.
Then, you can set S [I] [J] to indicate the probability that I team can make up to J questions. In this case, we also need to use DP [I] [J] [k] to represent the probability that team I made K questions in the previous J questions.
It is easy to find the opposite event.
Poj 3744
There are n mines. The starting position of a person is 1. The probability of each step is P. The probability of two steps is 1-P, and the position of N mines is given, ask the probability of successful exit from the minefield.
If you successfully walk out of a minefield, it means that each minefield has not been step on. You only need to find the probability of not stepping on each minefield. The probability of not stepping on the I-th minefield is 1-the probability of stepping on the I-th minefield. The minefield can be segmented by 1 ~ Num [1], num [1] + 1 ~ Num [2]... each segment has only one Lei num [I], and each segment is the same as the first segment. DP [I] indicates the probability at the I point, then DP [I] = DP [I-1] * P + dp [I-2] * (1-p ). Note that I is the starting position of each segment, and the first position of each segment must go. DP [1] = 1.
Cf d
It is also a probability, but it needs to be reversed to accurately identify the transfer of the State.
The probability of Princess Wang's victory in the presence of J black rats is DP [I] [J], which can be obtained from the following three States:
Wang Yu won a white rat for the first time with the probability of I/(I + J );
Princess did not get the white mouse, the probability of taking the black rat is J/(I + J), if the princess to win, the next time the dragon must take the black mouse, the probability is (J-1) /(I + J-1) while escaping is a black rat, probability is (J-2)/(I + J-2), status is transferred to DP [I] [J-3];
Princess did not get the white mouse, the probability of taking the black rat is J/(I + J), if the princess to win, the next time the dragon must take the black mouse, the probability is (J-1) /(I + J-1), also run away is the white mouse, probability is I/(I + J-2), the State is transferred to DP [I-1] [J-2];
Expectation:
HDU 4586
A dice has n faces, each of which has a corresponding amount of money. When it is thrown to M faces, an opportunity is increased. Finally, I got the expected amount of money.
This question is complicated and I don't know how to determine the final state. In fact, you only need to consider throwing once. The expectation for throwing once is P = sum/n. But if you throw one of the M faces, there will be another chance, the second throwing is exactly the same as the first throwing. The expectation for the second throwing is M/N * P, and so on. The expectation for throwing N is (M/N) ^ (N-1) * P. The sum of these expectations is the answer. We can see that N items are proportional series, and the ultimate sum is used.
Poj 2096 expected entry question
Program bugs include N Subsets and S types. Each bug belongs to each subset with a probability of 1/N, and each bug belongs to each species with a probability of 1/S. It is expected that every subset has a bug.
Listing the state transition equation solves the problem.
HDU 3853
The expectation of power consumed from [1, 1] to [R, C] is calculated. The power consumed by each step is 2, from [I, j] to [I, C, j], [I, j + 1], [I + 1] [J] probability.
It is also a simple expectation, just reverse push. Note that when the probability of the origin not moving is 1, [R, C] cannot be obtained ].
HDU 4405
There are n + 1 points, 0 ~ N. A person is standing at X now. If Flight lines exists at X, he can fly to the corresponding point without rolling the dice. Otherwise, he will move forward to the number on the dice. Asked him the average number of times he needed to throw a dice from.
Determine the final state DP [N] = 0 and then reverse push. There are two cases: roll the dice and not roll the dice.
HDU 4336
There are N types of cards. Each bag of snacks contains at most one card, which gives the probability of each card in a bag of snacks. Ask how many bags of snacks can be collected to all the cards on average.
N <= 20, compress the status, and determine the final DP [(1 <n)-1] = 0. Pay special attention to p1 + p2 +... + PN <= 1 indicates that there is no card in a bag of snacks.
Status is compressed. There are 1 <n-1 statuses, and DP [sta] indicates the average number of snacks bought from the current status to the target status, it is known that the final state DP [1 <n-1] = 0, DP [sta] can be obtained from the following State:
There is no card in this bag of snacks, the probability is P (the probability that there is no card), the status is transferred to sta;
This bag of snacks contains card J, but he already owns this card, probably a [J], and the status is changed to sta;
This bag of snacks contains card J, which has never been used before. The probability is a [J] and the status is transferred to sta | (1 <j)
Zoj 3640
Similar question type. A vampire is trapped and has n ways to escape. Each road has a difficulty C []. His initial combat power is F. For the I-th Road, if F> C [I], he will spend t [I] days to go out. Otherwise, he will stay for one day, increase the fighting capacity of C [I], and then select another way to go out, the probability of each route is the same. Ask him about the days he expected to escape.
Setting DP [I] indicates the expected value of escaping when the combat capability is I, then the state equation DP [I] = 1/N * t [J] (C [J]> I) can be introduced ), DP [I] = 1/N * (1 + dp [I + C [J]) (C [J] <= I ). The easy to ignore point is the final State determination, which should be Max * 2. Because I + C [J] is likely to be larger than Max.
Zoj 3329
Good questions. There are three dice, each with A, B, and C faces, and the probability of each side. The current status I. When the three sides roll out K1, K2, and K3 respectively, return to the status 0; otherwise, the status I + k1 + k2 + K3 is reached, expected number of throws> = N, the state transition equation is very good. DP [I] = P0 * DP [0] + PK * DP [I + K], A careful analysis of this equation is different from the above equation. It contains the required amount of DP [0] And a ring appears. It is found that each equation can be expressed by DP [0]. Then, set DP [I] = A [I] * DP [0] + B [I], the Recursive Formulas of a [I] and B [I] can be obtained from the above formula. Then, DP [0] can be obtained from a [0] and B [0].
Summary of probability DP