A common problem


Conclusions title.
Is converted to the coordinate system, the origin is the starting point to the discharge as a physics teacher go to the right (horizontal steps), a place to go up as biology teacher (vertical step)
can not exceed this line y = x.
Here you can then use the conclusions.
Conclusion: Let n be a non-negative integer, from \ ((0,0) \) to \ ((p, q) \ ) number of the lower diagonal rectangular grid path equals
\ [\ frac {p-q + 1 } {p +1} \ dbinom {
p + q} {q} \] in particular, there are several Catalan
\ [\ {n-FRAC {+}. 1. 1} \ {n-dbinom {2N}} \]

Knowing Conclusion
Title Let us find:
\ [\ FRAC {n-m ANS!!} {(N-+ m)!} \]
Where \ (ans = \ frac {n -m + 1} {n + 1} \ dbinom {n + m} {n}
\) Simplification will have a look \ [\ frac {n-m
+ 1} {n + 1} \] Code:

if(n < m) puts("0.000000");
else {
    double ans3 = 1.0;
    ans3 = ans3 - 1.0 * m / (n + 1);
    printf("%.6lf\n",ans3);
}

Guess you like

Origin www.cnblogs.com/gaozhuoyuan/p/11228043.html
Recommended