views

On the night of 25 February, 1991. An impact of US base by Iraqi Scud Missile caused 28 deaths and nearly 100 injured. But was the missile responsible for the 28 death? No, the reason was a programming error called Rounding Error.
Lets break it down.
This Programming error is actually a math problem, we human can't solve this. Yes, this is Infinity.
Basic Math
We can only assume or count something in a specific limit like 0,1,2,3,4,5,6,7,8,9. But there is more 1,2,3.......we can't even count them. Have you ever divided 10 by 3 by hand on your notebook? What we get? 3.33333333333..... to the infinity. But our notebook is limited(poor). So we only take 7-9 digits after the decimal and ignore the rest.
Processor Limit
Processor the brain of any computer. It handles the core calculation of any program. And it stores data in byte. Byte is like cell of processor. So, bytes are limited by number. So the digits after decimal processor handling have to be limited.
System Error
The US base was protected by MIM-104 Patriot Air Defense System. Generally we use 12/24 hour format to measure time, but for more optimization It used counter, which count every 0.1 second. Meaning 10 count every 1 second. But here's the catch, computer stores every data in binary(0/1). It also had to store the counter in binary. Let's see how the 0.1 looks in binary.
0.1 = 0.0001100110011001101...... And it repeats the same pattern to the infinity.
But as we know, we can't take anything infinite. The MIM-104 system was using 24-bit processor and it took about 24 number after the decimal.
So, instead of taking infinite number after decimal it took 24 number for processor limitation. And that's the catch.
This made a Rounding error of 0.000000095s per count.
So, in 1 count the system get late by 0.000000095 sec
And in 1 sec the latency rise to 0.00000095 sec.
As the MIM-104 Patriot was running for about 100 hour. The latency rose to 0.34 sec.
Missile
Name: R-17 Elbrus
NATO Name: SS-1C Scud-B
Launched by: Iraq
Target: U.S. Army barracks, Dhahran, Saudi Arabia
Warhead: High-explosive, ~985 kg
Speed: ~Mach 5 (≈1.7 km/s)
Result: 28 killed, 98 injured
Now let's see the calculation error of the system due to the rounding error:
Future position = Current position + (velocity × time)
As the system was 0.34 sec late and missile speed was ≈ 1700 metre per sec,
the system calculated the position of the missile (1700 * 0.34) ≈ 580 metre behind.
Which gave the missile enough time to hit its target and grabbing 28 human life.
After the incident the error was handled by better math integration.
If you want another part of how the problem was solved, I can write.
Comments
0 comment