The movie begins with a british private school where students get a test that tells them a number. If they have a high number then they are well loved and successful later on (inherent luck), if they have a low number then bad stuff keeps happening to them.
The highest marked girl in the school is fascinated with the lowest marked boy in the school. They try to talk but crazy stuff happens when they’re together. She always gets pulled away somehow.
He falls head over heals for her and explores sounds and words to find a way that they can spend time together. He discovers some words of power, seeming gibberish, that control the world around him. They’re related to music somehow.
He invites her to get coffee and keeps saying these random words to keep the universe from pulling them apart and they hit it off. As they spend more time together their numbers balance out and they become average levels of luck.
He also invents this device that can model people’s behavior perfectly.
Later on he gets rounded up by the government to discover words that can control people. Then they discover that a certain kind of music (Bach? Beethoven? Mozart?) removes the power from the words and allows people to resist being controlled. There is a guardian of the music who plays these songs on his piano when visited by the government and they can’t control him.
I can’t remember the name of this movie or any of the character but it was really interesting.