lawyerklion.blogg.se

Coding simple math equation to reverse animation timeline
Coding simple math equation to reverse animation timeline




coding simple math equation to reverse animation timeline

Each of those requires two cases, each of which requires two cases, and so on. The problem is that evaluating P(5, 7) requires calculating two cases: P(6, 7) and P(5, 8). For instance, computing (scorePercent 5 7 25) takes hours and hours.

coding simple math equation to reverse animation timeline

Unfortunately, the straightforward way of solving the problem has a severe performance problem. The first two arguments are the current score, and the last argument is the amount to win (25 in this case). I will use the notation P(m,n) for the chance of the first team wining if the score is m to n. (With side-out scoring, it makes a difference which team is serving, but for rally point scoring we avoid that complication.) The second obvious case is if a team has 25 points and the other team has 23 or fewer points, the first team has 100% chance of winning (since they already won). If we assume each team has a 50-50 chance of scoring each point and the score is tied, each team obviously has a 50% chance of winning the game. (Except if a third tiebreaker game is needed, it only goes to 15 points instead of 25.)Ī few cases are easy to analyze mathematically. In the league I was watching, the winner of a game is the first team to get 25 points and be ahead by at least 2. Rally point scoring also keeps the game advancing faster.) The winner of each match is the best out of three sets (a set is the same as a game). Fortunately, rally point scoring is more mathematically tractable. (Back in the olden days, volleyball used side-out scoring, which meant that only the serving team could get a point. Volleyball games are scored using the rally point system, which means that one team gets a point on every serve. I found the analysis interesting, and it turns out to have close ties to Pascal's Triangle, so I'm posting it here in case anyone else is interested. I made the simplifying assumption that each team had 50-50 odds of winning each point. I decided to analyze the game mathematically. But how much difference did getting one point at the beginning of the game matter? It seemed like it didn't matter much, but did it? Clearly, if the score was 24-24, gaining a point made a huge difference. And when a team gained or lost a point, I'd wonder how important that point was. At different points in the game, I'd wonder what the odds were of each team winning. Recently I was at a multi-day volleyball tournament, which gave me plenty of time to ponder the mathematics of the game.






Coding simple math equation to reverse animation timeline