LOOK HOW BAD COMPUTERS ARE AT MATH HAHA LOL
- Видео
- О видео
- Скачать
- Поделиться
LOOK HOW BAD COMPUTERS ARE AT MATH HAHA LOL
70 | 2 год. назад | 5 - 0
Are computers good at math?
How about we check that together?
Let’s ask the computer a simple questions, what is this number which is 599, with 12 nines in front of it minus 599 with 11 nines and 1 eight in front of it.
Now for our human brains the answer to that question is a simple 1. But when I ask the computer, it says 0.
Ok so how about Microsoft Excel, a lot of people use it for calculating stuff, let’s see what is 1 million.2 minus 1 million.1
Well obviously that’s 0.1, but when I show more decimal places, it gives me this number which makes no sense.
Ok so one million is a big number, let’s try just like 5.2 - 5.1 how’s that?
Well then I get 0.1, but if I expand the decimal places again there is this random other 1 here as well.
Let’s get away from Excel let’s go to Python, now Python is a fantastic coding language surely Python would get the correct results, right?
Let’s try 1 million .2 - 1 million.1 again, same issue. And for the 5.2 - 5.1 we also don’t get exactly 0.1. 0.3 times 3 = 0.89999 it’s not even 0.9.
Now you might be wondering why is this happening?
The simplest explanation I can give you is that you humans think in base 10, but computers think in base 2. They struggle to do floating point calculations, you would struggle as well if I asked you to do math that’s meant for another base.
For example if I ask you what’s 1 divided by 3, you would say 0.333333 to infinity, and then if I ask you what is that number times 3, you would say 0.99999999 which is actually just 1 right?
Computers struggle with memory though, they can’t just save 0.3333333 to infinity on them, they would crash right? And that’s why they have to give you approximations as answers.
Now you might think this doesn’t matter; but it does, in 1996 the Ariane 5 rocket self-destructed because of this issue.
So are computers bad at math? No I don’t think so, I think there are just bad programmers, programmers have to know this issue exists and not make computers do floating point arithmetics.
For our 5.2 5.1 example, why don’t we just do 52 - 51 and then divide it by 10, that would get us the correct results.
So don’t do floating points math and instead just like this video and follow for non-useless content.
Чтобы скачать видео "LOOK HOW BAD COMPUTERS ARE AT MATH HAHA LOL" передвинте ползунок вправо
- Комментарии
Комментарии ФБ