My family’s journey to the United States began with a unique first step: we won a lottery. This lottery didn’t come with a life changing amount of money. Instead, in 2002, it came with green cards for our family and the possibility of permanent residency in the United States. Four years after winning that lottery, my father, an ophthalmologist, was invited for a position in Santa Fe, N.M.

On the flight over, as we flew over the dry terrain of New Mexico that seemed devoid of all civilization, apprehension gripped my 9-year-old self. In the first couple of months, the situation didn’t improve. I’d begun life in Mumbai, a bustling city of 12 million where there was always something interesting to do. I’d spent most of my evenings outside, playing with the scores of kids in my neighborhood. Suddenly, I was all alone in a new country. Every day, as my mother would cook our dinner, I’d sit down on the kitchen floor of our apartment and complain, “Why can’t we go back to India?”

But after school started, everything changed. We’d moved to Los Alamos, a town famous for being the site of the Manhattan Project and having the highest concentration of PhDs in the United States. An air of science, discovery and innovation pervaded every corner of the town, and I became exposed to it through school. Specifically, I was fortunate to become involved in an after-school math program called “MATHCOUNTS.”

Mr. Koh, a practicing engineer with a PhD in engineering mechanics — as well as the MATHCOUNTS coach — volunteered to teach middle school math to a handful of fourth graders. Without question, Mr. Koh’s classes drew me to science. The first class had 30-something students, but for most of them, the equations that filled the whiteboard seemed boring compared to getting home two hours early. So, the attendance dwindled. I, on the other hand, saw the complicated math as a challenge that I absolutely had to tackle and devoted hours after school to teaching myself math.

Neither of my parents has a background in math or computer science, but those subjects just fascinated me like none other did. The satisfaction of solving a problem without prodding from a teacher became my drive for scientific study.

That’s not to say that my family had stabilized in our new home. About a year after we moved, the doctor, at whose practice my father worked, called. In a few short, devastating sentences, my father was informed that the practice was closing.

My father, trained as an eye surgeon, was turned down for other jobs he applied for. As the financial turbulence set in, I reacted by spending more and more of my time learning, particularly about math and computer science. I couldn’t control our economic situation, but I could control how much I learned.

My family bounced around for a number of years, and each move brought a new school and new environment. I held onto my love for science by devoting myself to it. Generally, the schools I attended had few resources, so I turned to self-study. After rushing through my school homework every evening, I’d spend three hours reading about computer science on the Internet, gobble down some dinner (late by American standards) and spend another couple of hours writing code.

All this time I spent working on anything that caught my fancy. I enjoyed having very little restriction or much direction in my work. After starting high school, I began to focus my work on problems that have significance within computer science and to society. I now live in Appleton, Wisc., a great town, but not one that’s brimming with research opportunities in computer science. So during my sophomore year, I started e-mailing professors to see if one of them could guide my research entirely over the Internet. I’d like to say I sent out a million e-mails and persevered, but as luck would have it, the first message I sent to Prof. Remzi Arpaci Dusseau of the University of Wisconsin-Madison came with a short, but incredible response: “Could we talk on the phone sometime?”

Since then, computer science research has become my focus outside of 7 a.m. to 3 p.m. On a given weekday, I’m likely to be found reading research papers or typing away at a computer to implement an algorithm. I’d like to continue working in computer science, although whether or not my work will be in academia I’m unsure. However, I know I’d like to major in computer science as an undergraduate and also participate in research as an undergraduate.

It’s been an incredible journey for me as an immigrant. I haven’t faced many of the problems that others have faced: I spoke reasonably fluent English when I arrived, and my parents are both educated professionals. However, I am positive about two things. I’m certain that without the drastic changes and economic hardship that came with my family’s transition, I would have never embraced science with such passion. And the opportunities and encouragement that the United States has provided me with (taken together with several bits of good fortune) have molded my life and plans for what lies ahead.

Dhaivat Pandya was a finalist in the Intel Science Talent Search 2015. He is a senior at Appleton North High School in Appleton, Wisc.