Professor mocks orphan girl, unaware she’s a math genius, her words win judges and secure her spot