News reports say that 2019 Philippine elections are severely affected by SD card glitches. If we go by the facts, there should only be ~8 machines affected by SD card failures. Only 0.01% of the vote-counting machines should be affected by these issues. Let's do the math and see why.
Here's some data we can gather from news articles. (Comelec says there are 961 machine failures, but these failures may or may not be related to SD cards.)
Key | Value |
---|---|
Total vote-counting machines (2) | 85,769 |
Vote-counting machines affected (1) (2) | 961 |
Defective SD cards (1) | 1,665 |
News reports claim there are 2 SD cards per machine. We don't know the exact setup, but my best guess is it's probably a RAID 1-like setup where the redundancy protects you from data corruption. For a machine to fail, both cards have to fail together.
-
"Each machine has 2 SD cards." (3)
-
'The poll body [Comelec] noted that protocols have been formulated as "there is a possibility that both the main and backup SD cards may be damaged while in transit."' (4)
-
"Jimenez, however, said there are 85,769 SD cards with the same number of backup cards." (5)
Only less than 1%
of SD cards were defective. This defect rate isn't unheard of when you're ordering 170k+ units of an item by wholesale.
There are 1,665
defective cards. We don't know how many SD cards there are, but we can estimate that there are probably 171,538
SD cards in total. Each vote-counting machine has 2 SD cards.
Key | Value | |
---|---|---|
Total vote-counting machines (2) | 85,769 |
|
Cards per machine (3) (4) | 2 |
|
Total number of cards (5) | 85,769 * 2 = |
171,538 |
Defect rate | 1,665 / 171,538 = |
0.97% |
There is less than 0.01% chance that a VCM will fail due to SD card issues. In other words, it's 99.99%+
likely that at least one of the cards will work.
The probability of getting a card is 1665 / 171538
, or 0.97%
(like above).
# Probability of getting a defective SD card
defective_rate = 1_665 / 171_538
# => 0.0097
The probably of 2 cards failing, however, is 0.009%
.
# Probability of getting a pair of defective cards:
# Get the probability of getting 1 defect, and the
# probability another defect on the next draw, then
# multiply them.
pair_defect_rate =
1_665 / 171_538 *
1_664 / 171_537
# => 0.00009415
Extrapolating from here, we can multiply that by the number of total VCM's (85,769
). That yields roughly 8.076
. That's how many machines are likely to be affected.
total_vcms = 85_769
total_vcms * pair_defect_rate
# => 8.07569
I did some simulations in Ruby (below) of how this would play out. Out of 500 simulations, 73 of them had 8
defective SD card pairs... so I suppose our math above checks out. Thanks to Bryan Bibat for the tip! The source code for this is in this Gist below.
1 defective pairs - 1x
2 defective pairs - **** 10x
3 defective pairs - **** 12x
4 defective pairs - *********** 2x
5 defective pairs - ******************* 48x
6 defective pairs - ******************* 48x
7 defective pairs - ************************** 65x
8 defective pairs - ****************************** 73x
9 defective pairs - *********************** 58x
10 defective pairs - ********************* 53x
11 defective pairs - ****************** 44x
12 defective pairs - ********** 25x
13 defective pairs - ***** 14x
14 defective pairs - *** 8x
15 defective pairs - ** 7x
16 defective pairs - ** 5x
17 defective pairs - 2x
-
The 961 VCM failures had nothing to do with the 1,665 SD card failures.
"That 1,000 SD cards didn't work is on top of the 450 VCMs that had to be replaced on Election Day." (6)
-
1,665 SD card failures isn't significant. It translates to only 8 machines affected. (And for these 8, there could've been some other contingencies for them.)
-
If polling precincts were stalled due to SD card issues, it's more likely to be a failure in logistics and organizing rather than a failure in equipment. The backup cards weren't given out until they found out that the primary cards fail.
“We respond by having replacement cards. This will be swapped with the corrupted SD Cards… so we do not issue out new SD cards unless we have the corrupted SD Cards.” (9)
-
Not all machines had 2 cards from the start, despite having enough cards on hand.
"Jimenez, however, said there are 85,769 SD cards with the same number of backup cards." (8)
-
Why are SD cards the primary transmission medium, rather than the contingency? Transmitting encrypted results online is faster and more reliable.
-
"The Commission on Elections (Comelec) said Tuesday that 961 vote-counting machines (VCMs) and 1,665 SD cards suffered glitches during the midterm polls on Monday." https://newsinfo.inquirer.net/1118605/961-vcms-1665-sd-cards-suffer-glitches-in-2019-polls
-
"The Commission on Elections (Comelec) disclosed on Tuesday afternoon, May 14, that 961 vote-counting machines (VCMs) bogged down in this year's elections" https://www.rappler.com/nation/politics/elections/2019/230604-comelec-says-vote-counting-machines-defective
-
"Each machine has 2 SD cards." https://www.rappler.com/thought-leaders/230839-how-to-fix-what-went-wrong-elections-2019
-
'The poll body [Comelec] noted that protocols have been formulated as "there is a possibility that both the main and backup SD cards may be damaged while in transit."' https://www.philstar.com/headlines/2019/05/09/1916345/comelec-issues-protocol-sd-card-replacement
-
"Jimenez, however, said there are 85,769 SD cards with the same number of backup cards." https://tribune.net.ph/index.php/2019/05/12/defective-sd-cards-discovered/
-
"That 1,000 SD cards didn't work is on top of the 450 VCMs that had to be replaced on Election Day." https://www.rappler.com/nation/politics/elections/2019/230543-number-sd-cards-that-did-not-work-may-13
-
“We don’t issue out new SD cards unless we get the corrupted SD cards in return,” Jimenez explained. https://tribune.net.ph/index.php/2019/05/12/defective-sd-cards-discovered/
-
"Jimenez, however, said there are 85,769 SD cards with the same number of backup cards." https://tribune.net.ph/index.php/2019/05/12/defective-sd-cards-discovered/
-
“We respond by having replacement cards. This will be swapped with the corrupted SD Cards… so we do not issue out new SD cards unless we have the corrupted SD Cards.” https://www.bworldonline.com/comelec-assures-it-will-be-ready-for-the-polls-despite-hitches/
-
"Comelec Chairman Sheriff Abas earlier said that out of 1,665 defective SD cards, the poll body was able to replace 1,253." https://businessmirror.com.ph/2019/05/17/comelec-told-come-clean-on-vcm-sd-card-glitches/
-
"The Comelec has 85,769 back up SD Cards ready for scenarios like this." https://www.bworldonline.com/comelec-assures-it-will-be-ready-for-the-polls-despite-hitches/
-
“Contingency SD cards allocated per regional technical hub amount to 125 per hub." https://tribune.net.ph/index.php/2019/05/12/defective-sd-cards-discovered/