Out here in Silicon Valley, you can’t cross the street without bumping into an engineer. And what you find is that three our of four of them are men. As Shankar Vedantam once reported in Slate:

The gender distribution of engineers at top Silicon Valley companies is similar to the gender distribution of the audience at your average strip club.

Creepy, but not surprising. According to stats out of the U.S. Department of Labor, women make up only one quarter of the workforce when it comes to jobs related to computers or math. Some folks call it the leaky pipeline: Women drop out of math and engineering programs before they ever hit the job market. I should know. I started college as a math major. By sophomore year, I bailed.

One theory that’s out there suggests that women opt out because of the perception that careers in engineering, by their very nature, are not compatible with future mommy-hood.

Another one, most odiously put forth by erstwhile Harvard president Lawrence Summers, former head of President Obama’s National Economic Council, is that women, by nature, just don’t have the mental chops for science and math. Ugh, right?

Turns out, neither of the above are true. According to a new study published in the American Sociological Review, one of the crucial reasons women opt out of careers in engineering before they’ve ever opted in is confidence. Or, more precisely, lack of same. It’s not that these women can’t make the grade, the study found. It’s that, when it comes to venturing out into the workplace, they don’t think they’ll fit.

You don’t have to be an engineer (and odds are pretty good that you’re not) — or ever have had dreams of being one — to find some resonance in what the study found.

The researchers surveyed 288 students who entered engineering programs in 2003 at MIT, the University of Massachusetts at Amherst, the Franklin W. Olin College of Engineering, and Smith College. They found that the women students took the same classes, took the same tests and earned the same — or higher grades — as the male students. And yet, they ended up feeling less confident in their abilities — or in the idea that a career in engineering was right for them.

One thing that’s interesting to note is that the prospect of parenthood had nothing to do with it, at least for the women. “We find that women’s desires to have a family do not influence whether they continue in an engineering major or plan to go into the engineering workforce,” said the study’s lead author Erin Cech, a Postdoctoral Fellow at Stanford University’s Clayman Institute for Gender Research. In fact, she told us, “The study found that men, rather than, women, were more likely to perceive that engineering was likely to interfere with raising a family.”

That settles that. What undermines the female students’ confidence, and persistence, Cech says, is what she calls micro-biases, or those subtle stereotypes about what men and women are naturally good at. “In engineering, for example, men are often thought to be “naturally” good at the “technical” aspects of engineering, where women are through to be “naturally” good at the “social” aspects of engineering, like teamwork and communication. If men engineering students are subtly though to be more competent at engineering tasks than women, then men and women engineering students will be treated slightly differently by their peers and their professors.” All of which snowballs in women, leading to a gradual erosion in confidence that they’ll ever fit in.

This new study seems to be right in line with an older one on that we’ve riffed on before. That one suggested that women avoid math and science, not because they lack the aptitude, but because they don’t feel welcome. Call it identity threat: women may avoid situations — like math or engineering — when they feel outnumbered. Researchers Mary Murphy, Claude Steele and James Gross found that when women math, science and engineering undergrads simply watched a video that pitched a fictional conference where men outnumbered women, the women showed the physical signs of threat — faster heart rates and sweating — and reported a lower sense of belonging, and less desire to participate in the conference at all. The researchers also found that the women who watched the gender unbalanced video were more vigilant of their surroundings overall.

Point being, it’s the threat, as much as the reality, that often keeps us out of the game. And not just when it comes to science or math.

A recent post on the Harvard Business Review noted that confidence was likewise one of the issues that kept women out of the corporate suites. As writers Jill Flynn, Kathryn Heath, and Mary Davis Holt — nationally recognized experts on women’s leadership — wrote:

Having combed through more than a thousand 360-degree performance assessments conducted in recent years, we’ve found, by a wide margin, that the primary criticism men have about their female colleagues is that the women they work with seem to exhibit low self-confidence.

They writers cite a 2011 study out of Europe’s Institute of Leadership and Management that quantifies the gender confidence gap (half of women managers admitted to self-doubt about their performance and career, for example, versus less than a third of men) and suggest that this lack of confidence leads to too much modesty; the inability to make the big ask; avoiding attention; and remaining silent, especially at business meetings.

Ouch.

All of this confidence gap comes at a cost. (Seventy-seven cents on the dollar, remember?) That which keeps us out of the labs and out of the boardrooms, often keeps us out of the money, right? But back to Erin Cech and her would-be engineers.

“The root of the problem are biases that are deeply embedded in people’s cultural beliefs about of gender and the nature of the work in science and engineering professions,” she told us. “The ultimate solution would be to change those beliefs. Such cultural change is maddeningly difficult and slow. So, perhaps the next best thing is to actually talk about the way that science and engineering fields are gendered within engineering and science classrooms. Such talk is considered “political” and thus “irrelevant” in most science and engineering classrooms, and so is never discussed. But, what could be more relevant than the retention of students within those very professions?”

Or, for that matter, any others. (Oh, for the record: It wasn’t lack of confidence that prompted me to change my major. Sigh. It was calculus.)

I almost choked on my Cheerios Wednesday morning when I read about an incomprehensibly sexist tee-shirt that JCPenney had attempted to market to tweener girls. The shirt not-s0-subtly trumpeted the retro stereotype that girls can be smart or they can be pretty. But never both. Its slogan, emblazoned front and center in colorful girly writing, was this: “I’m Too Pretty to Do Homework, So My Brother Has to Do it For Me.”

Color me outraged. The design, if you can call it that, featured hearts, flowers and a couple of easy math problems — one of them left undone.

The good news is that thanks to a fast and furious barrage from the twitterverse, JCPenney pulled the shirt off the market and, in fact, apologized. (As an aside, JCPenney has another tweener shirt still on the market. This one pimps a girl’s best subjects as boys, shopping, music and dancing.)

But the bad news is that they ever came up with any of this backlash-y nonsense in the first place: As if the “too pretty to do homework”shirt itself weren’t enough to set girls back a generation or two, take a gander at the ad copy: “Who has time for homework when there’s a new Justin Bieber album out? She’ll love this tee that’s just as cute and sassy as she is.”

Cute? Sassy? Justin Beiber?

The mind boggles and the heart sinks. It doesn’t take a degree in psychology to recognize that when girls are told that they’re no good at something — or that there’s still this false dichotomy between beauty and brains — it often becomes self-fulfilling prophecy. And so we have to wonder: is this kind of messaging one reason why — as Slate writer Shankar Vedantam noted a few months back:

Less than one in five professors of science and math at top research universities in the United States is a woman. The gender distribution of engineers at top Silicon Valley companies is similar to the gender distribution of the audience at your average strip club.

Strip club? Ouch.

Obviously, it’s all a bit more complicated than the outdated message that there’s beauty or there’s brains, and never the twain shall meet. But you have to wonder if these kinds of messages, subtle or otherwise, that we send to little girls often set the stage for deeper obstacles that keep women out of the game when it comes to math and science. Slate’s Vedantam went on to cite a study by Amherst psychologists who found that college women did better in math and science — and felt more comfortable in their abilities — when their professors were also female.

You don’t have to be a science geek to know where this is headed: the subtle discrimination that often impacts our choices. And part of that discrimination — let’s just call it sexism — may have to do with whether or not we have role modes who look like us and who make us feel that we belong.

An earlier study likewise suggested that women avoid math and science, not because they lack the aptitude, but because they don’t feel welcome. Call it identity threat: women may avoid situations — like math or engineering — when they feel outnumbered. Researchers Mary Murphy, Claude Steele and James Gross found that when women math, science and engineering undergrads simply watched a video that pitched a fictional conference where men outnumbered women, the women showed the physical signs of threat — faster heart rates and sweating — and reported a lower sense of belonging, and less desire to participate in the conference at all. The researchers also found that the women who watched the gender unbalanced video were more vigilant of their surroundings overall.

The point? Sometimes it’s the threat, as much as the reality, that does us in. Which could be why we often end up side-stepping opportunities instead of marching right in, loaded for bear. It’s kind of a chicken-or-egg scenario: Women who want to succeed — in math, science or the corporate boardroom — are more likely to do so if there are other women before them to pave the way. But how do those women get there?

Back to JCPenney and their sexist tee-shirt, the first step may be making sure young girls know that they don’t have to chose between beauty and brains — or Justin Beiber and schoolwork. And that, when it comes to their homework, they can do as well as their brothers any day.

Seeing as how this is the week of “fitting in” — or not so much — my ears perked up the other day when I was having a chat with a prof whose area of research includes career and workplace issues. When she mentioned a study that suggested that women may avoid situations — like math or engineering — when they feel outnumbered, I instantly thought Undecided.

I also thought of my daughters, who excelled in math in high school, but never pursued it. (I did — for one quarter of college. But that’s another story.) I also thought of women like one family member who has been a lawyer for years — but never really liked it. At one point, in fact, she took a career aptitude test (like that one our elusive Ms. X went searching for when she was in college) and found that all the results pointed in one direction: engineering. She wasn’t surprised. Just somewhat regretful.

But back to the study (you can link to a pdf here) in question. Researchers Mary Murphy, Claude Steele and James Gross found that when women math, science and engineering undergrads simply watched a video, pitching a fictional conference, where men outnumbered women, they showed the physical signs of threat — faster heart rates and sweating — and reported a lower sense of belonging, and less desire to participate in the conference at all. The researchers also found that the women who watched the gender unbalanced video were more vigilant of their surroundings overall.

All of which suggests one reason why women may avoid fields like math and engineering: it’s not “innate differences”, as erstwhile Harvard President Lawrence Summers infamously suggested back in 2005. It may be that we just don’t feel welcome.

All of which makes sense when we are talking science and related fields. But what about the workplace in general? Could these “social identity threats” be one reason we are often unsure of ourselves? Agonize over career decisions? Look over our shoulders? Stick with safe and risk-free women-friendly careers (which, incidentally, might be more comfy, but fall lower on the pay scale)?

Sometimes it’s the threat, not the reality, that does us in. Why we end up side-stepping opportunites instead of marching right in, loaded for bear. Add it all up and you just might find that, math rules notwithstanding, two and two equals five after all.