Susan and Rob wondered if Alex would eventually become transgender. They knew more doctors were giving puberty-blocking hormones to pubescent children considering a transition to the other sex. The hormones not only buy time but also spare the young teenagers the angst of developing secondary sex characteristics that feel terribly wrong to them. Even Zucker supports hormones for teenagers who want to become the opposite sex, because mounting evidence indicates it best eliminates their misery. Yet many question whether adolescents are mature enough to make such life-altering decisions, especially when the drugs’ long-term effects are unknown.

Though Alex was a long way from facing those decisions, the possibility hovered in Susan’s mind as she watched his emotional upheaval that autumn in preschool. He became obsessed with a particular lavender dress and fell apart whenever it was in the wash. Alarmed, Susan and Rob decided to limit dress days to Tuesdays and Saturdays, telling Alex he couldn’t fairly expect them to launder it more often. Their fuller reason was more complicated. For one thing, they didn’t have the emotional strength to take him out in a dress every day, to deal with the double takes and the implied judgments. For another, they had noticed how, depending on his mood and his clothing, Alex comported himself in very different gendered ways. While they continued to furnish Alex with toys and activities from all across the gender spectrum, they hoped that more time in boy clothes might help him feel more comfortable with society’s expectations for his biological sex, especially given the likelihood that he’d grow into a male-identified adult.

Still, it was hard not to wonder what Alex meant when he said he felt like a “boy” or a “girl.” When he acted in stereotypically “girl” ways, was it because he liked “girl” things, so figured he must be a girl? Or did he feel in those moments “like a girl” (whatever that feels like) and then consolidate that identity by choosing toys, clothes and movements culturally ascribed to girls? Whatever the reasoning, was his obsession with particular clothes really any different than that of legions of young girls who insist on dresses even when they’re impractical? Or any different than tomboys who are averse to those same clothes?

No one knows why most children ease into their assigned gender roles so effortlessly and others do not. Hormone levels might play a role. One hint is provided by a rare genetic condition known as congenital adrenal hyperplasia, or C.A.H. The condition produces high levels of androgens, including testosterone, early in gestation, and can create somewhat male-like genitalia in genetic females. Girls with C.A.H. are typically raised as females and given hormones to feminize, yet studies show they are more physically active and aggressive than the average girl, and more likely to prefer trucks, blocks and male playmates. Though most turn out to be heterosexual, women with C.A.H. are more likely to be lesbian or bisexual than women who weren’t bathed in prenatal androgen.

Genetics might also be a factor in gender expression. Researchers have compared the gendered behavior of identical twins (who share 100 percent of their genes) with that of fraternal twins (who share roughly half). The largest study was a 2006 Dutch survey of twins, 14,000 at age 7 and 8,500 at age 10. The study concluded that genes account for 70 percent of gender-atypical behavior in both sexes. Exactly what is inherited, however, remains unclear: the specific behavior preferences, the impulse to associate with the other gender, the urge to reject limits imposed on them — or something else entirely.

Whatever biology’s influence, expressions of masculinity and femininity are culturally and historically specific. In the 19th century, both boys and girls often wore dresses and long hair until they were 7. Colors weren’t gendered consistently. At times pink was considered a strong, and therefore masculine, color, while blue was considered delicate. Children’s clothes for both sexes included lace, ruffles, flowers and kittens. That started to change in the early 20th century, writes Jo Paoletti, a professor of American studies at the University of Maryland and author of “Pink and Blue: Telling the Boys From the Girls in America.” By then, some psychologists were arguing that boys who identified too closely with their mothers would become homosexuals. At the same time, suffragists were pushing for women’s advancement. In response to these threatening social shifts, clothes changed to differentiate boys from their mothers and from girls in general. By the 1940s, dainty trimming had been purged from boys’ clothing. So had much of the color spectrum.

Women, meanwhile, took to wearing pants, working outside the home and playing a wider array of sports. Domains once exclusively masculine became more neutral territory, especially for prepubescent girls, and the idea of a girl behaving “like a boy” lost its stigma. A 1998 study in the academic journal Sex Roles suggests just how ordinary it has become for girls to exist in the middle space: it found that 46 percent of senior citizens, 69 percent of baby boomers and 77 percent of Gen-X women reported having been tomboys.