Twenty-year-old Will Hunting of South Boston is a natural genius who is self-taught and been recently paroled from jail. He works as a janitor at MIT and spends his free time drinking with his friends Chuckie, Billy, and Morgan. When Professor Gerald Lambeau posts a difficult combinatorial mathematics problem on a blackboard as a challenge for his graduate students, Will solves the problem anonymously, stunning both the students and Lambeau. As a challenge to the unknown genius, Lambeau posts an even more difficult problem; he later catches Will writing the solution on the blackboard late at night, but initially thinks Will is vandalizing it and chases him off.