TorakMcLaren
TorakMcLaren t1_j5yy4hm wrote
Imagine you do an experiment. You find somebody from every age from 1 to 100 and you measure their height. Then, you plot these on a graph. Experience tells you that for the first 20 years or so (probably less, but let's roll with it) you get taller and taller. This happens quickly at first, but slows down as you approach 20. Then, your height stays flat for the next 50 years or so, until 70. Then, beyond that, you begin to lose a bit of height. The "line of best fit" of the data you've collected should fit that pattern. It should be a smooth curve that peaks around 20 and plateaus for a while, before gradually dropping at the end.
Say instead you tread your data like a dot-to-dot. You connect 1 to 2 to 3 to 4... with straight lines and sharp corners. This would be overfitting the line. Instead of seeing the whole smooth progression, your line might make you think or heights go up and down constantly. Maybe you happened to pick a tall, early-developing 12 year old and then a short, late-developing 13 year old. The line you've drawn makes it look like we peak at 12, then immediately shrink, before slowly growing again. Perhaps the 50s were all shorter women and the 60s taller men, or maybe they even alternated!
Point is, you're giving too much weight to each individual datapoint rather than to the general trend.
This is similar to overfitting in machine learning. Every part of your training dataset has certain flukes and random features. If you train on too small a set for too much, you end up with a system that is very good at dealing with the training images but not so good at stuff beyond that.
TorakMcLaren t1_j2f2fdc wrote
Reply to ELI5. What does "return" do in programming? I read about it a lot and still dont understand the purpose. by BlendsLoL
Computers do lots of calculations. The vast majority of the time, you don't want to actually know the answer to a calculation. You only want to know a certain thing when a certain other thing happens. You use "return" to output the answer.
Let's say you want to look for Pythagorean triples, three numbers a, b and c such that a²+b²=c², where a, b and c are all positive whole numbers. You get the computer to run through different options for a and b. It will square them and add them together. Then, it takes the square root of that and checks if it's a whole number. If it is, then you've found one and you want to know about it. But the rest of the time, you don't care!
You'd maybe set up the code to try 1²+2²=1+4=5. It tries √5, but it's not a whole number.
Okay, now it tries 1²+3²=1+9=10. But √10 doesn't work either.
Then 2²+3²=4+9=13, but √13 ×
1²+4² fails.
2²+4⁴ fails.
But 3²+4²=9+16=25 and √25=5. So the computer has found a solution and returns 3,4,5.
TorakMcLaren t1_j1ywqwo wrote
There are two main ways we experience colour in things. Things which give off light use additive mixing: red+green=yellow. This is what RGB colour is, where the primary (or base) colours are red, green, and blue, and is how screens work. The more light you add, the brighter it gets. Add in all the colours, and you get white.
Then we get subtractive colour. Instead of stuff giving off light, everyday objects will reflect some light and absorb other light. A red t-shirt looks red because it gets hit by "white" light (or light of all different colours) and absorbs everything except the red. It reflects the red, so we see it as red. As it happens, one of the easiest way to mix colours in this space is using cyan, magenta, and yellow as the bases - the primary colours. These are the exact secondary colours of light, the additive colours. The more of a pigment you add, the darker it gets. If you mix all three, you get black...sort of. It's tricky to get a really good black, so in printing we tend to just use a seperate black to Deal with that. We call this CMYK (with K being black, obviously... /s).
Now, Pantone is designed to be a system for getting really good printed colours which can be used across different manufacturers. You can think of it as being a sort of translation between colour schemes. Another side of this problem is that computer screens can only produce so many colours. The Hex system you mention means representing each RGB pixel with 3 values from 0 to 255 (one per colour), with 0 being off and 255 fully on. That's a smaller number of possible values compared to what our eyes can cope with. This is part of the reason dark videos look so blocky, almost pixelated. When the lightest value in a shadow is 9 and it fades to complete black (0), there are only 10 possible values in that range. So the steps are obvious. But Pantone is designed for ink where you can just dilute colours further and further to get shades in-between.
TorakMcLaren t1_ixz4rle wrote
Reply to comment by istoOi in ELI5 : How do electric shocks kill you? by EaAeEaAe10
To expand (pardon the pun), muscles work by contracting when electricity goes to them. Your nerves send electrical signals, and the muscles pull. If you constantly pass electricity through them, they'll stay pulled, and you won't be able to relax them to be able to breathe.
The heart is a muscle. Chambers of it expand and fill with blood, then contract (thanks to a wee electrical timer) and fire blood around the body. Rogue electric signals can mess with this timing and can make it stop.
TorakMcLaren t1_jacsonl wrote
Reply to ELI5 How did we figure out the order for PEMDAS? Like how do we know that that order is correct? by ToodlyGoodness
There's a sense in which it's totally arbitrary, like the alphabet. It could be any order, but the important thing is that we settled on a particular order.
On the other hand, there's a sense in which the order we use was the only one that made sense, or maybe one of two that made sense. Let's forget about division and subtraction for a second. Multiplication is just repeated addition, and exponentiation (or "order" if you use BODMAS) is just repeated multiplication. So it really only makes sense to go power-multiplication-addition or addition-multiplication-power. Then, we get parentheses (or brackets for BODMAS). The whole point of brackets is to say "DO THIS BUT FIRST," so it has to be at the start.
Now, subtraction and division are just shorthands for adding negatives or multiplying by fractions, so that's why they go in pairs with addition and subtraction being equal and multiplication and division being equal.
So why exp-muli-add? Well, we often want to write something like 3y²+2y+6. If we used add-mult-exp, then we'd need to rewrite this as:
(3×(y²))+(2×y)+6
So we pick the format that makes the notation simpler and easier to read.