In a downtown office cubicle, next to a file cabinet topped with a philodendron in a wine carafe, a Boston public schools computer specialist dispassionately clicked a mouse.

It was 10:11 on a Friday morning. By 10:18, the computer program had silently assigned nearly 12,000 students to 134 city schools - the good and the bad, the underperforming and the overachieving - based on their parents’ choices, their proximity to the school, and a healthy heaping of luck.

The following afternoon, that clean, algorithmic efficiency sent waves of emotion rippling through neighborhoods all across the city. Chrissanta Rudder jumped up and down in the hallway of the Old Colony public housing development in South Boston. Kimesha Janey-Rogers of Roxbury sighed and tossed her son’s assignment letter into the recycling bin. Parents who had spent months researching schools, visiting open houses, talking to principals, and trading strategies for the lottery raced to their mailboxes to open letters they feared would test their commitment to city living.

“The poor mail person got accosted on the street probably every five steps: `I heard the letters are out. I heard the letters are out,”’ said Kimberly Bertrand of Charlestown. “I don’t think that mailman had a very good day.”

Bertrand did. As she opened the assignment notice that Saturday a week ago, she leapt and wept tears of joy. Her 4-year-old, Jack, got her first-choice school: the Warren/Prescott K-8 School in Charlestown. Her letter prompted a champagne toast with her neighbors but more muted exchanges at playgrounds and birthday parties, where others might not have been so lucky.

Darren Durlach/Globe Staff

Betty Legendre of Mattapan learned her 3-year-old did not win a preschool assignment.

“There are very good friends of his who didn’t get in,” Bertrand said. “There’s definitely no jumping up and down in public.”

Boston public schools’ lottery is used to distribute students without bias across a district with schools of dramatically differing quality. Parents rank their choices, and their children have a better chance of getting into a school that’s close to home or that a sibling already attends. But there are no guarantees, and the assignments rely in large part on the random number each student is assigned by the computer. So a system designed for fairness can inevitably cause divisions among winners and losers.

Some winners described emotions like guilt for having gotten into the school they wanted. Some losers were openly bitter.

“My initial knee-jerk reaction was animosity toward the families that got in,” said Chris Koons, whose pre-kindergartner, Charlie, did not get an assignment because there are not enough preschool slots for everyone who applies. Koons had to keep reminding himself that the lottery is intended to give everyone a fair shot at good schools. “It kind of helps that nobody we know got in anywhere,” he said.

The lottery assigns students in transition grades - preschool and kindergarten, sixth grade and ninth - and most students get one of the schools they requested. But the lottery presents a sometimes daunting barrier to families who are just entering the public school system. Despite all the time their parents spent choosing schools, 272 kindergartners - 7.6 percent of the children who applied - got none of their choices.

The Globe is following 13 families who are just starting in the Boston public schools and trying to enroll children in preschool or kindergarten. Of those families, eight were happy with the results of the lottery, while five were disappointed.

The school assignments provoked difficult questions for a number of the families, with some saying they might consider paying for private school or even move out of the city. Some, even after learning the results, remained mystified by the complex process that drives student assignments.

Betty Legendre, a Haitian immigrant and mother of three children who moved to Mattapan from Atlanta last summer, was crushed to learn last Monday that her 3-year-old daughter had not been assigned to a public preschool. Though her son got his fourth-choice school, Legendre can’t afford day care and was hoping to get both children in school and get back to work.

She thought she’d gain an advantage by applying on the first day of registration; she didn’t. She thought there would be a spot for her 3-year-old; there wasn’t. The Boston public schools offer free full-day preschool to 3-year-olds through the lottery but have precious few available seats.

Now, Legendre said, she is considering leaving Boston, possibly even moving back to Haiti.

Anna Ross woke up Saturday feeling sick to her stomach. When the letter dropped into her Dorchester mailbox just before noon, it seemed weighted with a winter’s worth of worry.

Inside, she found the name of the family’s second-choice school for her 4-year-old, Ita. And all at once, the worrying was over.

“That’s a huge relief,” she said. “I wasn’t expecting that at all.”

Although her own outcome was happy, she said the lottery system still seems wrong.

“It shouldn’t feel this lucky that our child got into a school we wanted,” said Ross.

The preschoolers who win the lottery are especially lucky. Of the 2,202 families who applied for pre-kindergarten, 514 families - 23 percent - got none of their choices. And roughly half of those children won’t get into any school in the city. Boston schools have seats for only 88 percent of the 4-year-olds who apply. They get free, full-day pre-kindergarten and a guaranteed spot in kindergarten.

Next week, families that weren’t so lucky will be notified of their placements on school waiting lists and begin hoping that some students change their plans by fall. Others will try their luck again, reentering the lottery for a second round that ends March 31, to assign seats remaining in schools that did not fill up or had shorter waiting lists.

But that means taking another chance on different schools that didn’t attract them the first time around, a frustrating prospect for some who just went down this long road. Ingrid Martin of Jamaica Plain said she did everything the school system told her to do: getting informed, attending school open houses, opening her mind to different schools, and listing 10 schools as choices she would accept.

“For all those hours and all that effort, we get nothing,” she wrote on an online parents’ discussion group. “Why is putting my child in kindergarten in PUBLIC SCHOOL so stressful?”

She’s willing to enter a second round of the lottery, Martin said in an interview. But she would like some resolution soon.

“You’re a working parent, you get to a point where I just want to get this checked off my to-do list,” said Martin. “I need an answer here so I can take a deep breath and move forward.”