If not for a fluke, Abdisamad acknowledges, he might have joined friends to become part of the tide of migrants making a precarious journey by sea to Europe. How he came instead to Harvard is a tribute to his hard work and intellect, but also to luck, and to an American hedge fund tycoon who, bored by finance, moved to Somaliland and set up a school for brilliant kids who otherwise wouldn’t have a chance.

The financier, Jonathan Starr, had an aunt who married a man from Somaliland, and he was charmed by stories about its deserts and nomads. So in 2008, after running his own hedge fund and burning out, Starr took a trip to Somaliland.

His friends thought he was nuts for what happened next: Starr founded an English-language boarding school for the brightest boys and girls from across Somaliland. Called the Abaarso School of Science and Technology, it uses American teachers (paid a pittance) who are willing to work in a country that the State Department recommends avoiding for security reasons. The school is surrounded by a high wall and has armed guards to foil Shabab rebels, and it has an American sensibility: There is a girls basketball team, which is so unusual in Somaliland that the team members have almost no one to play against.

This campus is where Abdisamad blossomed.

He says his parents divorced before he was born, so his grandmother raised him. He spent an average of two hours a day fetching water and had no one pushing him at home, but still performed superbly at a local primary school. In national eighth grade exams, he scored second in the entire country.

The problem was that while primary school tuition had been $1 a month, a good high school would be at least $40 a month. His grandmother couldn’t afford that, and in any case she didn’t really see why he needed high school. No one in his family had ever graduated from high school.