It is a matter of probability. Males produce 1/2 sperm cells carrying the X chromosome and 1/2 with the Y chromosome, thus determining 1/2 girls and 1/2 boys in the progeny, respectively.
If different matings are independent (and this assumption could be analysed separately for matings within a couple and among couples), then the probability of having a progeny or generation of n individuals of only one sex is 1/2 to the power of n.
In your question, n is 5 or 500, then the probability under these assumptions is 1/32 = 3.125% (unlikely, not impossible) for the first and a value under 10 to the power of -150, that is, 0.(150 zeros)3, for the second -- virtually 0.
Another assumption that must be made is that public schools draw randomly from the general population, or if there is a bias (for example economical) this does not affect the girls/boys natural distribution.
One assumption that needs to be made further is whether the 1:1 distribution holds from meiosis to conjugation, prenatal development, birth and childhood. It is here that it is believed that some bias is introduced. Nevertheless, all other assumptions being true, if girls going to a public school are 52% of the total, then the above probability would go to aproximately 0.(141 zeros)1.
When a male produces a sperm gamete, the Mendel's 1st law of segregation states that each new sperm cell will get only one of each paired chromosomes. In males, they have X and a Y sex chromosomes. Therefore, each sperm cell will carry 23 chromosomes, either with an X or Y. Therefore, barring a genetic abnormality there is a 50% for each conception of having either a male or female. It is much more likely that a family had six girls than a community of 500 families having only girls. A simpler example might be that if you flipped a coin 6 times, it is much more possible that all flips landed on heads than if you flipped the same coin 500 times.
"Whether or not a fertilized mammalian egg ultimately develops into a male or female is determined by the winner of a tug of war between two different genes encoding signaling proteins and the divergent pathways they control."
A man and woman mate and have six girls and no boys because of the XX of the mother and the XY pf the father. The six girls are the result of the XX winning the "battle" for sex of the child.
In a School setting you have many parents and a much larger gene pool. You have many more combinations which will be matched. The chances of the XX winning over the XY in a population of 500 is very unlikely.
There is a 50% chance of having a boy or a girl, but when it comes to school unless it is an all girl school. There are many more possibilities, as there are many parents and many different men available. Therefore the chances to have a boy in a school increases.
A Punnett Square matrix for people's gender, would take a parent XX and a parent XY. See below:
X XX XX
Y XY XY
You have a 50/50 coin toss on this every time you have a kid. The genders of the kids you already have will have no bearing on any new coin tosses you're going to make in the future. Every child had a 50% shot of being a girl with a fresh slate on every coin toss.
You need a bigger sample. Picture your bio class, or school cafeteria. Have everyone who (at some future time) could have kids pair off (madness ensues). Each pair tosses a coin between them. After enough coin tosses you have a bigger sample. If you record the gender of each successive coin toss, the numbers would level out to look more like 50/50.
So, a little sample of 6 individuals isn't representative for an entire city population. A big sample (10, 000) might work better. In that sample, you'd find that for every 6 daughter family, there's (generally speaking) a 6 son family to balance it out.United States: Estimate: 97 Males/100 Females, Margin of Error: +/-0.1 Males/100 Females Source: U.S. Census Bureau, 2006 American Community Survey