For why so few girls major in computer science in college, below is my answer. Sorry to say this, but I have to conclude that my points below are the main ones to explain the data and so far have received too little attention on this thread.

From a standard point about good parenting, nearly all the girls with good parenting had mommies who were happy being mommies.

For more, I draw from

E. Fromm, 'The Art of Loving'.

and

Deborah Tannen, 'You Just Don't Understand: Women and Men in Conversation'.

So, I continue:

Way before age 5, the little girls realize that they are small versions of Mommy and NOT Daddy. They know in absolute terms that they are a GIRL and NOT a BOY.

Since their mommy was happy being a mommy, the little girls want to be like Mommy and on the 'mommy track'.

By about age 18 months, little girls are already masters at eliciting positive emotions from adults, MUCH better than boys. The girls are also MUCH better at reading emotions than boys. Facial expressions and eye contact are part of how the girls read and elicit emotions; other ways are to 'act' (they are MUCH better at acting than the boys) cute, meek, and sweet and to be pretty. Since being pretty lets them do better eliciting positive emotions, they love pretty dresses with ruffles and ribbons. So, they are in a 'virtuous circle': They act sweet, elicit positive emotions in an adult, e.g., father, grandfather, uncle, get a gift of a pretty dress, wear the dress, elicit even more positive emotions, get even more pretty dresses, white bedroom furniture, patent leather shoes, cute stuffed animals, etc.

Having to act like a boy or be treated like a boy, instead of like a girl, would be terrifying to them.

So, in their first years, such little girls, to be on the 'mommy track' want to play with dolls and not Erector sets, want to work at being pretty and not how to hot rod a car, want to learn how to bake a cake and not how to plug together a SATA RAID array.

Give such a girl a toy truck and she will know instantly that the toy is 'for boys' and will avoid it as a big threat.

Generally, from a little after birth and for nearly all their lives, human females are MUCH more emotional than human males. So, they pay a LOT of attention to emotions, both theirs and others'.

One of a human female's strongest emotions is to get security from membership in, and praise, acceptance, and approval from, groups, especially groups of females about their own age. That is, they are 'herd animals'. Gossip? It's how they make connections with others in the herd. Why do they like cell phones so much? For more gossip. Why pay so much attention to fashion? To 'fit in' with the herd.

In such a herd, in most respects the females try hard to be like the 'average' of the herd and not to stand out or look different. [An exception is when a female wants to lead her herd, e.g., go to Clicker, follow the biographies, get the one for the Astors, and look at Ms. Astor and her herd of 400.] Well, as long as human females with good parenting are on the 'mommy track', and the human race will be nearly dead otherwise, the 'average' of the herd will emphasize the 'mommy track', dolls, looking pretty, cakes, and clothes and not Erector sets, hot rodding cars, or building RAID arrays.

When it comes to a college major, any human female 18 months or older will recognize in a milli, micro, nano second that her herd believes that mathematics, physical science, engineering, and computer science are subjects for boys and NOT girls. Instead the girl subjects are English literature, French, music, acting, 'communications', sociology, psychology, nursing, maybe accounting, and K-12 education. By college the girls have been working 24 x 7 for about 16 years to fit in with the herd of girls, and their chances of leaving the herd in college to major in computer science are slim to none.

Don't expect this situation to change easily or soon: Mother Nature was there LONG before computer science, and, as we know, "It's not nice to try to fool Mother Nature.". Or, to get girls to major in computer science, "You are dealing with forces you cannot possibly understand.". Having women pursuing computer careers give girls in middle school lectures on computer careers will stick like water on a duck's back -- not a chance. Nearly all the girls will just conclude that at most such careers are for girls who are not doing well fitting into the herd of girls, are not very good socially, don't get invited to the more desirable parties, don't get the good dates, are not very pretty, and are not in line to be good as wives and mommies. By middle school, the girls have already received oceans of influences about 'female roles', and changing the directions these girls have selected and pursued so strongly for so long is hopeless.

Besides, 'middle school' is an especially hopeless time: The girls have just recently entered puberty, just got reminded in overwhelmingly strong and unambiguous terms that they are now young women, have received a lot of plain talk from their mothers, grandmothers, aunts, and older sisters about the birds and the bees, in their gossip with their herd members have been discussing the birds and bees with great intensity, already have a good woman's figure or nearly so, really, are well on their way to, in another year or so, being the most attractive physically they will ever be and know it, notice men of their age up to age 80 or so looking at them as women, and are in no mood to consider being 'more like boys'. Middle school is about the worst possible time to try to get the girls to fight Mother Nature. Suggestions of such lectures are 'clueless' in grand terms.

So, a typical scenario is a boy in middle school who is really excited because he just understood how an automobile differential (TCP part of TCP/IP, binary search, virtual memory, etc.) works and with great excitement tries to explain it to a girl his age at, say, lunch, and we have a strict dichotomy: The boy is totally clueless that the girl couldn't be less interested. The girl sees right away that she couldn't be less interested, not to offend the boy unduly pretends to be a little interested, and sees in clear terms that the boy is totally clueless at perceiving her lack of interest. She concludes that he is so clueless he is really easy to manipulate (a fact she suspects could be useful and saves for later). The boy doesn't understand the girl, and the girl regards the boy, and soon, all boys less then 2-6 years older than she, as at least 'socially' immature and, really, just immature. She wants nothing to do with such 'children' (she already understands that a woman needs a strong man) and will concentrate on boys 2-6, maybe 8 or 10, years older than she is. She has a point: She was likely more mature socially at age six than he will be at age 16.

Look, it's WAY too easy to fail to understand: So, we can just assume a simplistic 'rational' model. In this model, sure, we can teach 2 + 3 = 5 and (2 / 3) / ( 5 / 4 ) = 8 / 15, and both the boys and the girls can learn, although typically the girls will do better on tests in such things than the boys. So, we entertain that the boys and girls can exercise all their 'rational' abilities and, thus, can learn and do well with anything their rational abilities permit. Nonsense. Naive, clueless nonsense. Instead, Mother Nature says that in addition to rational abilities are emotions and commonly has the emotions overwhelm the rational abilities.

Net, such a simplistic rational model is clueless, even dangerous, nonsense. Give a girl of 4 a toy truck and take away her dolls in pretty dresses, and she will cry, and the crying will be heartrending to any adults around who will quickly swap back the truck and the dolls. It's no different at age 13 in middle school or 18 in college.

Actually, there can be a reason for a girl in college to take some courses in computer science: Look for a husband!

It may be that in college girls of Asian descent are more willing to pursue math, physical science, etc. than are girls of Western European descent.