No.8001 This Is What Probability Theory Is Like, Right?
タグ : / 解いたユーザー数 41
作問者 :
LayCurse
Problem Statement
For a couple with $2$ children, it is known that the probability that the $1$st child is male is $X$ and the probability that it is female is $1-X$, and furthermore that the probability that the $2$nd child is male is $Y$ and the probability that it is female is $1-Y$.
Now, under these conditions, write a program that finds the probability that the $1$st child is male and the $2$nd child is female.
Taro, who is good at math, pointed out that this may not be uniquely determined, so find the maximum and minimum values of the probability that the $1$st child is male and the $2$nd child is female.
Input
$X$ $Y$
$0 \leq X,Y \leq 1$ are given with at most $5$ digits after the decimal point.
Output
Output the maximum and minimum values of the required probability, separated by a single space.
Your answer is considered correct if the absolute error is at most $10^{-9}$.
Sample
Sample 1
Input
0.00000 0.00000
Output
0.00000000000 0.00000000000
In this world, males are simply never born, so it must be self-evident that the probability in question is absolutely $0$.
Sample 2
Input
1.00000 0.00000
Output
1.0 1.0
In this world, the $1$st child is always male and the $2$nd child is always female.
What on earth was Taro all about?
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。