John Nash is a talented but asocial mathematician, who catches attention of the Pentagon and is invited there to crack encrypted enemy telecommunication. He surprises other decrypters by his ability of deciphering the code mentally. But this job also leads him to obsession about searching for these hidden patterns and he starts communicating with imaginary people who encourage him whenever he is depressed.