Stella Tsai was sitting on the bench hearing a matter in a criminal case Friday morning so she didn't immediately know she had won a political lottery.

Tsai, appointed last year by Gov. Wolf to a temporary position as a Philadelphia Common Pleas Court judge, had been selected for the first position on the May 16 primary election ballot. She is seeking a full 10-year term on the bench.

Because she was working and the lottery was held in Harrisburg, a state employee drew the lot that secured Tsai's lucky ballot position.

There are 48 candidates for 10 vacancies on the court in the primary.  The first ballot position is a big deal.  Just ask whoever drew number 48.

"I can't downplay its significance," Tsai said. "I know I have to still work hard for every vote."

Tsai seems qualified and capable to be a judge. She's already doing the job.  But what if she weren't? What if she were a professional mess?

This is the way we elect our judges -- almost completely random, names drawn in a lottery.

David Thornburgh, president of the  good government watchdog group Committee of Seventy, called the system "foolish and anachronistic."

Elections for judges in Philadelphia always draw a crowd.  What they don't draw is strong interest from voters. On Election Day, many of them have little or no idea about whom to support. And many of them vote for the first name on the ballot.

It's like throwing darts wearing a blindfold trying to hit justice.

"The sad thing is that ballot order matters most when people know least about the candidates," Thornburgh said. "It's what we call low-information voting."

The problem extends to Philadelphia's Municipal Court, where 26 candidates have filed to fill three vacancies.  Every one of them also filed as candidates for Common Pleas Court.

That's the game here. Candidates file for both courts, hoping for a good pull in the ballot lotteries.  If they get a great ballot position for one, they drop out of the other race.

It's like buying a Powerball ticket and a Mega Millions ticket at the same time. If one doesn't make you rich, maybe the other will hold more luck.

Jonathan Tannen of Econsult Solutions has studied the impact of ballot position in four Common Pleas Court elections from 2009 to 2015. Good luck is not held exclusively by the first ballot position. In crowded elections, being in the first row of candidates also  helps.

"The stark reality: The pure luck of drawing a position in the first column of the ballot was worth more than the endorsement of the Democratic City Committee, the Philadelphia Inquirer or the Philadelphia Bar Association's Judicial Commission," Tannen wrote in January.

In another blog post from December, Tannen noted that the candidate to pull the first position in the 2015 election for Common Pleas Court judges, Scott DiClaudio, won "despite having been repeatedly and publicly censured for his poor performance as an attorney."

In March 2016, two months after DiClaudio was sworn in as a judge, the Pennsylvania Supreme Court rebuked him for "serial misconduct." That rare public censure was the result of DiClaudio's fourth disciplinary issue since 2003.

Tannen on Friday said he found it "hard to imagine there is a constituency for the current system."

In truth, there is more than one system in Pennsylvania, where 67 counties use 10 different voting systems to operate 25,361 ballot machines.

Tannen suggests that technology allows for voting machines to randomly order ballots from one polling place to the next, leveling the playing field.

The Pennsylvania Department of State, which oversees elections, is not sure whether the voting machines could handle randomization software.

Even if they could, the state Election Code would have to be amended to allow for that.

State Sen. Anthony Hardy Williams of West Philadelphia introduced legislation in 2011 to try randomization on ballots in just this city. That effort went nowhere.

Williams, a Democrat, plans to try again this year. Maybe the legislation will move forward this time, he said, or maybe it will at least get the conversation started.

"This is clearly one of those cases where many people are impacted by the judicial system but a majority of us don't pay attention to who we are electing," Williams said.