Playing cards
54 poker, the average three, king size probability in the hands of a man given to
The number of combinations can be directly calculated, we put out two cards, is 16,18,18
The man is equivalent to 16 to 52 cards in the take twelve, because two people are 18, so go heavy
Molecule can be determined as C (52,16) * C (36,18) * C (18,18) * 3
Similarly seeking denominator C (54,18) * C (36,18) * C (18,18)
The equation is then the number of combinations, i.e. 18 * 17 * 3 / (54 * 53) = 17/53
#include<bits/stdc++.h> using namespace std; const int MD=1e9+7,N=2e6+5; int f[N],v[N]; void Init() { v[0]=v[1]=f[0]=f[1]=1; for(int i=2; i<N; i++) f[i]=1LL*f[i-1]*i%MD,v[i]=1LL*v[MD%i]*(MD-MD/i)%MD; for(int i=2; i<N; i++) v[i]=1LL*v[i-1]*v[i]%MD; } int C(int n,int m) { if(m<0||m>n) return 0; return 1LL*f[n]*v[m]%MD*v[n-m]%MD; } int main() { Init(); int n,m; while (cin>>n>>m)cout<<C(n,m)<<"\n"; return 0; }
Of course, some people did not want to write the number of combinations, molecular written in C (52,18) * C (34,18) * C (16,16) * 3 is also possible, but the common denominator is not so good-looking, value is the same
King was able to get to someone as a reference, and have to be able to get Wang. King can appear anywhere in the 3 × 18, Wang must appear in the same hands, but it appears a king in the (total 17) can not occur.
3 × 18 × 17 i.e.
a total of 3 × 18 × 53 case, i.e., the same position is not Wang king. This is the younger brother of rabbit practice, I think it is very clever, oh
The question becomes extended, a person holding 20, the other two people take 17. Landlords of the real situation hhhh
Of course, landlords probability is higher, but how much is it specific, we can look at
The denominator is relatively simple, first write the denominator C (54,20) * C (34,17) * C (17,17) * 3
The three men could card is 181 717 and 201 715
Write molecule is C (52,18) * C (34,17) * C (17,17) * 3 + C (52,20) * (32,15) * C (17,17) * 6
Points can be calculated approximately 0.434661, above that value is 0.320755
Some students think a first glance is 1/3, but in fact go wrong
For example, two cards, some people think it is 1/2, in fact, is a slightly smaller number than 1/2, 16/53.
Why this happen, because was occupying, you have this card will take up that position, it can not take on directly the probability
We can consider the six cards given to two people, this works out to 2/5, in fact, the formula is (n / m-1) / (number of heaps n represents the number of cards, m for minutes) (n-1)
Four people, two king size remove the remaining 52 cards. A hearts Q spades and A at the same time to get the probability of a person, and that you will soon figure out 12/51, and next door it was still autistic
But as long as you do not or can not be divided equally split the points will be about annoying problem, certainly before bisects this number is less than 1 / m, after not bisect certainly larger than 1 / m, which can be considered magical inequality bar