# Confusion with simple Binomial Distribution example

I'm following the paper available here. The Binomial distribution is used to calculate the probability of obtaining 26 babies of the same sex from a total of 44 births. If the probability of giving birth to a boy is equal to that of a girl then - according to the paper -

The probability of observing at least 26 babies of the same sex in 44 births is 0.2912 under this assumption.

However if I calculate the probability of x > 25 using the pbinom() function in R as

> pbinom(25, 44, 0.5, lower.tail = FALSE)
 0.146


I realize that 0.146 + 0.146 = 0.291, which could be taken to mean that the probability of getting 26 babies of the same sex = P(x > 25) boys + P(x > 25) girls. Is this reasoning correct? If yes, then when I change x to be x = 21 then P(x > 21) = 0.56, in which case "probability of observing at least 22 children of the same sex would be 1.12 which seems wrong as the probabilities should be less than 1. What am I doing wrong?

Because in the second one, when number of boys is $$22$$, number of girls is also $$22$$. Both the number of boys and girls fall into the same event this time, unlike $$26,18$$ split. However, you count this probability twice when you multiply with $$2$$. Also, in either case, the probability $$1$$, because no matter how you split boys and girls, one of them will be larger than $$21$$.

Note: $$P(X=22)\approx 0.12$$, which is what you count twice.

• This is a correct objection to the incorrect second method shown. (+1) The first method using R is OK if done correctly: 2*pbinom(25, 44, 0.5, lower.tail = FALSE) returns 0.2912152. – BruceET Mar 30 '19 at 18:39

A table of possible outcomes in R; event is 'At least 26 of same sex'. Outcomes that do not satisfy the event show 0; not all of the 38 complementary possibilities are shown.

b = 0:44;  g = 44-b;  event = (g>=26 | b>=26)  # symbol '|' means OR
rbind(b, g, event)[ ,18:28]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
b       17   18   19   20   21   22   23   24   25    26    27
g       27   26   25   24   23   22   21   20   19    18    17
event    1    1    0    0    0    0    0    0    0     1     1


Probability: $$P(\text{Event}) = 0.2912.$$

sum(dbinom(b[event], 44, .5))
 0.2912152


A good normal approximation (with continuity correction) is $$P(\text{Event}) = 0.2913.$$ [The normal approximation could also be done by standardizing and using normal tables, but with a little additional inaccuracy.]

1 - diff(pnorm(c(18.5, 25.5), 44/2, sqrt(44/4)))
 0.2912928


In the figure below the exact binomial result is the sum of the heights of the bars outside the vertical dotted lines. The thin black curve is the approximating normal PDF. 