My girlfriend took Berkeley's introductory CS class as an undergraduate. She did well in the class, got an A, but she was really put off by the attitude of many classmates who had prior programming experience and judged her for not having any. It doesn't have to be with programming languages: it can be with things like setting up your UNIX shell, using emacs, ssh etc... something that we take for granted but had to learn at one point or another.
While she didn't intend to Major in Computer Science in the first place, I can't help but think that the environment was almost deliberately designed to make sure that somebody who had great potential to be an excellent programmer couldn't accidentally realize it (much as Jean, the author of the article did). Women who are good at programming still end up deciding against it as a career; on the other hand, many men are horrible at programming, but persist at it.
Interestingly enough, in Russia/former USSR the male:female ratio is in Computing is slightly better (more females) than other technical fields. I am not sure whether that's still the case (I left former USSR in 1996). My mother is a software engineer (she introduced me to Scheme and OCaml, back when you weren't considered a real programmer if you worked in anything other than C++). She had many female colleagues when she worked in a Computer Science research lab (back in the days of [Soviet clones of-] PDP-11s, VAXen and IBM 370s, ATT UNIX, etc... when programming was much more incidentally complex than it is now).
I'm not sure math makes all that much of a difference either because the most experienced people in my class were all doing math-related things (myself a physics minor, my girlfriend a math minor, and my two other friends a math and physics double major, respectively).
I just wouldn't worry so much about experienced students or give them something extra to work on if they wanted it. I started programming when I was 9, meaning I had been messing around with Linux, systems, programming languages, and algorithms for a full 9 years before stepping into my first class freshman year. My professors did the proper thing and used the finals from the freshman year CS courses to propel me to upper level courses in my first quarter. Don't try to work against experience, work with it.