A computer can do all the calculations to decide on if it's a good idea. Given the inputs of the time they have spent together, the number of glances that are passed between then in the halls between classes, if he doesn't have a date yet or not, etc. The probability adds up to ask.
So the machine decides to ask.
The girl feels it. Has all the time they've spent together has made her feel a certain way? Maybe a weird tingle each time their arms touch. Is that glance in the hall this morning not just an accident, but him going a little out of his way for her to notice? She's asked around and knows that no one else has asked him, but doe he really not have a date yet? Can she overcome the bit of anxiety about asking a boy to the dance? Will she be able to accept the risk of rejection knowing that the chances may be high he says yes?
Only she can choose.