Click the green flag to randomize ballots and run the solutions. All the interesting parts of this project is in the code, so look inside. It's an implementation of the solution to the problem presented here: https://www.theguardian.com/science/2023/mar/06/can-you-solve-it-the-science-of-streaming "An election is held between candidates A, B, C and D. You are given a set of 100 completed ballot papers and your job is to work out whether any of the candidates has an overall majority, i.e. won 51 or more votes. If a candidate has done so, you must say who it is. But there’s a catch. You are not allowed to count the ballot papers." @PutneyCat brought this to my attention here: https://scratch.mit.edu/studios/25643089/comments/#comments-215877985 All code by me (@kriblo). In the randomization, I added a slight advantage to candidate A, to make a majority more likely for this demo. The project provides two solutions (see inside), of which Solution 2 might be more intuitive, but Solution 1 is more effective. Solution: https://www.theguardian.com/science/2023/mar/06/did-you-solve-it-the-science-of-streaming