Premier League Predictor: FastAPI & PostgreSQL — Chapter 6, Exercise 2 ==================================================== TASK Explain why this chapter resolves the guest-averaging problem by averaging each guest's own points rather than averaging their raw predicted scorelines, using a concrete example of two guest scorelines that cannot be meaningfully averaged directly. SOLUTION A football scoreline is a pair of whole numbers that only means something as a pair — "the home team scored this many, the away team scored that many." Averaging two different scorelines numerically doesn't produce another valid scoreline, because there's no such thing as a fractional goal actually being scored. Concrete example, straight from this chapter's own worked fixture: one guest (Micah Richards) predicted 3-0, and another guest (Jamie Carragher) predicted 1-0. Averaging those directly, field by field, gives (3+1)/2 = 2 for home and (0+0)/2 = 0 for away — "2-0." That result happens to look valid by coincidence in this particular example, but it's not actually a meaningful average of what the two guests predicted; it's just an arithmetic side effect, and with slightly different numbers (say 3-0 and 0-2) it breaks down completely: (3+0)/2 = 1.5 for home, (0+2)/2 = 1 for away — "1.5-1," which isn't a real scoreline at all. Points, by contrast, are already just plain numbers with no such constraint. Each guest's prediction is scored individually by the exact same score_prediction() function used for every other source — Micah Richards' 3-0 and Jamie Carragher's 1-0 both correctly called the real 2-1 home win, so each earns 10 points. Averaging 10 and 10 gives 10 — a completely well-defined, meaningful number, with no risk of landing on something that can't exist, no matter what the underlying scorelines were. WHY THIS WORKS AS AN ANSWER ---------------------------- It explains the real structural reason a scoreline can't be meaningfully averaged (it only means something as a whole-number pair), gives a concrete example using this chapter's own worked fixture showing the averaging breaking down into an impossible result, and explains why averaging points instead sidesteps the problem entirely since points carry no such pairing constraint.