Dr. Ali Orooji needs a hug. It has been a tough week, so he needs as many as he can get.

Here’s the question: How many hugs can Dr. Orooji receive, at most, if he crosses a rectangular room full of friends who are standing at varying distances from him, with varying interest in an embrace.

This may seem unanswerable to anyone not steeped in algorithms and the 0s and 1s of computer programming. But for the gifted students of the UCF Programming Team, which Dr. Orooji advises, this is kids play. In fact, the students devised this problem for the High School Programming Tournament held on campus each year.

“They like to put me and my children in the problems,” said Dr. Orooji, an associate professor of Computer Science.

He is happy to oblige if it helps get young people interested in computer programming. U.S. students have fallen behind those in other countries when it comes to mastering the rigors of programming. In the competition UCF participates in, Russia has won the world championship eight times and China four times since 2000, he said.

“The time and effort we put into football and basketball, they put into programming problems,” he said. “They start in high school. If we played football with the Russians and Chinese, we would demolish them. But they beat us in programming competitions.”

Dr. Orooji is not alone in his concern, which has economic and national security implications for the United States. Donations have been made to UCF  that allow Dr. Orooji to offer programming team scholarships. The support frees students from taking part-time jobs, so they have more time for studies and programming practice.

The goal is for the UCF team to one day win the world championship in the prestigious Association for Computing Machinery International Collegiate Programming Contest. The last time the prize went to the United States was in 1997, when Harvey Mudd College won.

There are good reasons to believe in the UCF team. In 32 years of competition, 25 of them under the leadership of Dr. Orooji, the team has earned an international berth 25 times, reaching as high as second place against teams from as many as 45 regions of the world. UCF will again match wits with international contestants when the team travels to Russia in June, after winning the 2013 Southeast Championship in the United States.

It takes dedication and rigorous practice to win championships. The UCF students, who compete in three-member teams, spend 40 to 45 Saturdays a year listening to an hour-long lecture, solving problems for five hours (the length of a contest) and then absorbing assessments. During the week, the students read and search out new algorithms that might give them an edge.

Dr. Orooji arrives early for those long, Saturday sessions and leaves late. “I try to make it fun,” he said. He is assisted by several former team members who serve as volunteer coaches.

On the way to a world championship, Dr. Orooji’s first goal for his team is to make the top three in the United States, competing against such universities as Harvard, Stanford and MIT, and top 10 in the world.

Partial scholarships have been offered to promising freshman, creating a junior varsity level to allow them to develop. To encourage female participation in competitive programming, partial scholarships have also been offered to female students, bringing the number of women on the team to seven this year.

Looking ahead, Dr. Orooji is optimistic that the UCF team, boosted by the funding, will achieve lofty goals.

“UCF’s overall performance is matched by very few schools in the world,” Dr. Orooji said. “We have finished as high as second, fourth and fifth in World Contest Finals. It should be noted that finishing fifth, for example, means fifth out of 8,000-plus teams. That means UCF finished in top one percent in the world.”