Premier League Predictor: FastAPI & Redis — Chapter 8, Exercise 2 ================================================================= TASK Use the script to make the user and the expert finish on the same points but with different correct-score counts, then make three sources tie on both keys. Report the leaderboard for each case and say what decided it. SOLUTION Case 1 - tie on points, different correct-score counts Fixture 1: user 40 points, expert 0, AI 0. Fixtures 2-5: expert 10 points each. totals: user 40, expert 40 records: user:scores 1, expert:results 4, expert:scores 0 Leaderboard: user (-4000001), expert (-4000000), ai (0), guest (0) The user is ahead: both have 4000 hundredths x 1000, but the user's one correct score adds 1 to the composite (which makes the score more negative, so it sorts first). Case 2 - three sources tied on both keys Fixture 1: user 10, expert 10, AI 10 (correct results, no correct scores). Leaderboard: ai (-1000000), expert (-1000000), user (-1000000), guest (0) Nothing separates them, so Redis orders equal scores by member name, ascending: ai, expert, user. This is an arbitrary fallback, not a rule of the competition; the guest, with no points, is last. WHY THIS WORKS AS AN ANSWER ---------------------------- Both orderings come from real runs of the chapter's script, each attributed to the exact part of the composite that decided it, and the full tie is identified as an arbitrary fallback rather than passed off as meaningful.