r/educationalgifs • • Sep 30 '18

Binary

https://gfycat.com/DearCandidGerbil
9.1k Upvotes

127 comments sorted by

2

u/anomalous_cowherd Sep 30 '18

It would be nicer if the diagonal line of 'held' balls that show the binary number was highlighted somehow, also if they came out a little slower so there's time to see the binary number before the next ball comes down and disturbs the LSB.

Overall not bad though.

1

u/Fawaz2000 Sep 30 '18

Oh yeah great idea

847

u/CinnamonJ Sep 30 '18

I don’t know if I learned anything but I definitely want some sixlets now.

128

u/kevinnetter Sep 30 '18

Sixlets?

Are those like Skittles?

95

u/CinnamonJ Sep 30 '18

They’re more like m&ms but with an almost fruity note to the taste.

20

u/superspacehero Sep 30 '18

It seems like I only ever see them during December - I'm not sure I've ever seen them any other month of the year

24

u/gusbyinebriation Sep 30 '18

They’re in a lot of the cheaper Halloween candy bundles in the US.

6

u/superspacehero Sep 30 '18

Ah, I guess I never ended up seeing them in those, which I can't really complain about. To me, they've always tasted just kinda...off

4

u/Th3S1l3nc3 Sep 30 '18

That’s the only time they’re in season. The sixlet shrub is a very fickle mistress. She only takes to the purest of snows.

7

u/Ihavesubscriptions Sep 30 '18

‘Cause they have carob in them. They’re really good though, Next time I visit the states I need to track some down.

-2

u/sharkiest Sep 30 '18

Aren’t skittle just fruity m&ms?

4

u/telltolin Sep 30 '18

skittles don't have chocolate (or similar carob in the case of sixlets), they're just chewy fruit candy

-1

u/sharkiest Sep 30 '18

So what you’re saying is they’re fruity m&ms

3

u/thathawkeyeguy Sep 30 '18

Considering the defining characteristic of M&Ms is chocolate, no. That's like saying marbles are just glassy M&Ms.

1

u/sharkiest Sep 30 '18

Aren’t they?

3

u/FlyByPC Sep 30 '18

Sixlets are tasty chocolate/carob candies with a hard shell.

Skittles were invented by Satan to trick you into eating chewy fruit candy when you think you've scored yourself some m&ms.

1

u/magicalraven Sep 30 '18

F O R B I D D E N

4

u/den_Pol Sep 30 '18

Fuck I loved sixlets r/nostalgia

6

u/Romulus3799 Sep 30 '18

I hate that this sub is okay with upvoting cool but completely uneducational gifs. If I didn't already know how binary works, I definitely wouldn't know after watching this gif.

2

u/helpless_bunny Sep 30 '18

Well now I do!

2

u/absurdmanbearpig Sep 30 '18

I just barely saw some sixlets yesterday and thought hmmm.. that’s something I rarely get or think to get and thought about getting some. It’s weird that they’re popping up all over the place.

1

u/pure710 Sep 30 '18

I need to see them sorted at the bottom!

173

u/soamaven Sep 30 '18

So it takes 16 bit flips to set the 5th bit down the circuit?

71

u/AlphaGoGoDancer Sep 30 '18

16(Dec) is 0b10000 so yep

63

u/[deleted] Sep 30 '18 edited Sep 30 '18

Correct. That comes from powers of two:

  • 20 = 1

  • 21 = 2

  • 22 = 4

  • 23 = 8

  • 24 = 16

With one binary digit you can store either 0 or 1. With two digits you can store one of four values, from 0 to 3. With five four it's 0 to 15.

It's the same as what you're used to with base 10 except now you jump columns much faster.

EDIT: If I had a dollar for every off-by-one error in this post, I'd have two dollars.

8

u/soamaven Sep 30 '18

Is this a demonstration of setting transistor circuit bits or just a base 2 visualization though?

13

u/Pochend7 Sep 30 '18

This is a base two visualization. The only part that is missing for the transistors is power/electricity.

1

u/[deleted] Sep 30 '18

I can't speak for transistors, but I'm sure this is a decent representation of storing numbers in hardware.

The balls would represent electricity and the switches are individual bits. Every switch storing a ball is actually storing an electric charge. Need to add 1 to the current number stored? Send a new ball. When it hits an empty spot (a 0) it stays there, otherwise it keeps going, setting all the 1s it passes to 0s by emptying their stored charges. It's literally "carrying the one", like regular addition.

2

u/soamaven Sep 30 '18

The transistors store gate voltage information, so there's 3 leads actually, so I wouldn't think it need be serial, but idk. I vaguely remember the basic XOR/NAND/OR etc diagrams, they get complex fast. I should look into this.

0

u/[deleted] Sep 30 '18

[deleted]

2

u/soamaven Sep 30 '18

Wow, that's pretty awesome! This was the quality answer I was looking for. The bit about utilizing the change of rise or descent is particularly clever! I have a lot of respect for EEs.

2

u/rewardadrawer Sep 30 '18

With five it’s 0 to 15.

You’re slightly off. With four bits, you are able to store 16 values, ranging from 0 to 15. The fifth bit again doubles the number of values you can store to 32 (0 to 31).

You can empirically prove this by using one hand to count binary values (using each finger to represent a power of two). Using five fingers (bits), you are able to count to 31 before needing another finger (bit).

9

u/[deleted] Sep 30 '18 edited Sep 30 '18

A bit flip is a 0 changing to a 1 or a 1 changing to 0. In the GIF, that's whenever one of these swivels flips to the left or flips to the right.
And of those, more than 16 occur, because of carryover.

You count up like this:

 0 = 00000000
 1 = 00000001 -> 1 bit flips
 2 = 00000010 -> 2 bits flip
 3 = 00000011 -> 1 bit flips
 4 = 00000100 -> 3 bits flip
 5 = 00000101 -> 1 bit flips
 6 = 00000110 -> 2 bits flip
 7 = 00000111 -> 1 bit flips
 8 = 00001000 -> 4 bits flip
 9 = 00001001 -> 1 bit flips
10 = 00001010 -> 2 bits flip
11 = 00001011 -> 1 bit flips
12 = 00001100 -> 3 bits flip
13 = 00001101 -> 1 bit flips
14 = 00001110 -> 2 bits flip
15 = 00001111 -> 1 bit flips
16 = 00010000 -> 5 bits flip

So, a total of 31 bit flips occur.

5

u/[deleted] Sep 30 '18

I don't think the gif shows them in that order. I'm not really sure when the sampling should take place since it seems some numbers are duplicated by continuous sampling.

If left is off and right is on just the beginning of it seems to go like this:

0, 1, 0, 3, 2, 1, 4 ...

52

u/pandymic Sep 30 '18

Elegant little animation, but not very educational. Someone recently posted this video. It's a little more ELI5.

https://youtu.be/zELAfmp3fXY

7

u/si1versmith Sep 30 '18

Binary, brought to you by The Killers.

1

u/pandymic Sep 30 '18

Hah. I never actually played it with audio on. Guess it could be worse.

If I recall correctly the original post was just a giphy of this YouTube video.

14

u/198587 Sep 30 '18

This is more confusing than binary.

7

u/Nobodieshero816 Sep 30 '18

Looks like a marble drop game I played on PC waaay back. Was like Davincis Marble Drop. Super puzzle game and as you progressed used color marbles

3

u/KKlear Sep 30 '18

Davincis Marble Drop

That's what the game was called! I've been thinking about it from time to time, but never managed to find it. Thanks!

1

u/Nobodieshero816 Sep 30 '18

I enjoyed this game. It had so many levels.

5

u/offby1 Sep 30 '18

Maybe inspired by Dr Nim.

5

u/jerpower Sep 30 '18

Here's a real world representation of something very similar. https://www.turingtumble.com

2

u/Whaty0urname Sep 30 '18

Didn't the creator of this post on Reddit when his game was put on the shelf in his local store?

2

u/FiniteCreatures Sep 30 '18

Yes he did like a month ago.

1

u/jerpower Sep 30 '18

I'm not sure. I do know it started with the kickstarter for pre-orders, and now it looks like it's fairly mainstream. Looks pretty neat.

1

u/NathanielWolf Sep 30 '18

I was going to post this! I have one, we love it.

2

u/jerpower Sep 30 '18

Do you? Awesome! I was wondering about a real world example, my daughter and I love all the brainy video games and movies and this seemed right up our alley. Thanks!

2

u/NathanielWolf Sep 30 '18

Totally worth it! My daughter loves it. It gets pretty challenging (we are about halfway through the book) but it’s a really great way to learn some very basic computer engineering.

It’s presented with puzzles mixed into a sort of graphic novel which is a great format for younger kids. There’s just enough story to hang the puzzles on without it feeling tacked on.

The board is really fun to just play with, it’s tremendously satisfying to watch in a zen sort of way, and completing a challenging puzzle feels super rewarding. Highly recommended!

4

u/Monstot Sep 30 '18

This gif is not educational at all for people who have no clue what this is supposed to represent.

2

u/Tim5000 Sep 30 '18

I know binary and was left more confused than before I learned it.

9

u/TheNeutralGrind Sep 30 '18

The balls had to be in a specific order for any of that to function...

3

u/semperverus Sep 30 '18

I think that's the point, and the colors are there to help you understand. You could do this with gray balls and have the same result just less pretty. I don't think it was about the colors themselves.

1

u/fraggleroni Sep 30 '18

What do you think would have happened if all the balls were the same color?

1

u/TheNeutralGrind Sep 30 '18

Then they would just be balls falling.

0

u/[deleted] Sep 30 '18

[deleted]

2

u/TheNeutralGrind Sep 30 '18

Uhh...... yes

2

u/anti_anti Sep 30 '18

Thanx that made me unlearn all the litle pieces of undestanding floating all over my brian about binary i had,now im back to cero again but the .gif was cool

2

u/ThicccBoi420 Sep 30 '18

What if 2 balls that are the same color fall consecutively

1

u/voodoo_curse Sep 30 '18

Color is irrelevant

1

u/[deleted] Sep 30 '18

Apart from being an exponential distribution, does this have any other resemblance to any naturally occurring phenomena?

1

u/Sebetastic Sep 30 '18

The ending was the best part.

1

u/emailrob Sep 30 '18

This will be on LinkedIn by tomorrow with hundreds of 'wow, where can I buy one' comments.

1

u/[deleted] Sep 30 '18

This could be a guest counter at a steam punk convention

1

u/HashSlingingSlash3r Sep 30 '18

Essentially the logic is

`def add(self):

if 0: toggle(self) if 1: toggle(self), add(self+1)`

1

u/voodoo_curse Sep 30 '18

Code blocks in markdown are four spaces

1

u/DrSlizzard Sep 30 '18

Anyone else catch themselves counting 'aloud' in their head?

1

u/quadrophenicum Sep 30 '18

Any second ball of the same colour in a row will break the logic of this thing.

1

u/WitheredTechnology Sep 30 '18

Thought I took a shroom for a second

1

u/everneveragain Sep 30 '18

I wanna see where they’re going

1

u/prodigy2throw Sep 30 '18

Ahh now it makes sense

1

u/CoupleofAvengers Sep 30 '18

Seems like a dope computer wallpaper

1

u/FrostyZed Sep 30 '18

My head hurts

1

u/defjamblaster Sep 30 '18

yeah, that educated me

1

u/[deleted] Sep 30 '18

No one likes when it overflow

1

u/ColoquialQueso Sep 30 '18

But what if the first one isnt red?

1

u/[deleted] Sep 30 '18

Thanks, that's now crystal clear.

0

u/[deleted] Sep 30 '18

[deleted]

50

u/prodigy2throw Sep 30 '18

Why don’t you explain this to me like I’m 5?

47

u/bloodfist Sep 30 '18

Eacg of the flippy things is a number. If the flippy thing is pointed to the left its a zero and if it's pointed to the right its a one.

If a flippy thing is already set to one, it has to become a zero again, and the number to its left becomes a one. It literally rolls over to the next place.

This is how counting in binary works.
0000
0001
0010
0011
0100
0101
And so on

With the flippy things, we count higher by sending in another ball. In binary we add one to the end of the number just like any other counting. In both cases if the number or flippy thing is already 1, we carry it to the left until we hit a zero.

18

u/RiikG Sep 30 '18

Pretty sure is harder to explain the GIF than binary. Looks great tho

8

u/-Chareth-Cutestory Sep 30 '18

You know I actually understood that. Rolls over like an odometer just base 2... thank you!

3

u/bloodfist Sep 30 '18

Exactly how I always visualize it! Cool 😎

3

u/MadMaxGamer Sep 30 '18

Neat ! Now explain it to me like im a polar bear.

4

u/bloodfist Sep 30 '18

Raaawr rawwer 0 Raaawr rawr 1.

0000
0001
0010
0011
0100.

Raaawr. Raaawr rawwr roar rawr rawwr.

2

u/MadMaxGamer Sep 30 '18

Thats great and all, but my brother is a 1908 combine harvester with a broken carburator that is haunted by the ghost of Abraham Lincoln. Can you explain it so someone like him can understand ?

2

u/Squrtle-Aristurtle Sep 30 '18

So, say I put x=25 is that stored in memory as 25 or as 2,5 (in binary)?

1

u/tabaczany Sep 30 '18

I don't know what you mean by 2,5. It is stored as 25. The number is always the same, no matter in what kind of numeric system it is written. Basically it can be shown as 16 + 8 + 0 + 0 + 1.

1

u/Squrtle-Aristurtle Sep 30 '18

There has to be a limit though, right? I know mathematically there's no limit, but what's the largest number that can be stored in a byte? There has to be a limit to what a computer can do too. If you had a big enough number it would fill up the entire memory.

1

u/tabaczany Oct 01 '18

There is a limit. In byte (byte is 8bits) you can store 28 or 256 values: from 0 to 255. You have probably heard about 32bit or 64 bit operating systems. That number is the number of bits you can store in the smallest fragment of addressable memory. Of course there are other problems like how to store fractions (floating point arthemtic), negative numbers (twos complement). And there are some tricks with which you can store bigger numbers than ones limited by operating system: "joining" two addresses to create one number giving 2128 number in 64bit system, and so on...

1

u/bloodfist Sep 30 '18

It would be stored as 11001

You can quickly count to that by adding the places together. Each place is a power of 2.

16 8 4 2 1

16+8+1 = 25

Or count up to 25 using the method above.

11

u/Zacjacobi Sep 30 '18

You know how when you count, after 9 you go to the next digit and then go back to zero? Well, it’s the same for binary, but instead of looping at ten, you loop at 2. So it would be 01 = 1, 10 = 2, & 11 = 3

6

u/TheCasualJedi Sep 30 '18

100=4?

4

u/Zacjacobi Sep 30 '18

Yes. Exactly

12

u/TheCasualJedi Sep 30 '18

Mom look! I’m a computer!

1

u/mypasswordis-123456 Sep 30 '18

hey kid, im a compyootah.

3

u/dudemcbob Sep 30 '18

If we want to know how many balls went through, we can check the final position of each rocker instead. This is how computers remember numbers. The rockers are called "bits", and we write 0s and 1s to represent the rocker being to the left or the right.

1

u/Zacjacobi Sep 30 '18

You know how when you count, after 9 you go to the next digit and then go back to zero? Well, it’s the same for binary, but instead of looping at ten, you loop at 2. So it would be 01 = 1, 10 = 2, & 11 = 3

1

u/jaywalk98 Sep 30 '18

Binary is simple once you learn how to convert from binary to decimal, these gifs make it seem infinitely more complicated.

5

u/stonebraker_ultra Sep 30 '18

I found this visualization much more confusing than actual binary.

3

u/[deleted] Sep 30 '18

Do u need to know math to understand this

4

u/Squrtle-Aristurtle Sep 30 '18

Not really, just how counting works.

5

u/AltmerAssPorn Sep 30 '18

That's math

3

u/SetOfAllSubsets Sep 30 '18

Not really.

00, 01, 00, 11, 10, 01, (000), 100, 111, 110, 101, (100), 000, (0011), 1011

Which is 0,1,0,3,2,(0),4,7,6,5,(4),0,(3),11

The ones in parentheses happen when a green or yellow ball is in the air, about to flip to 1, while the red ball has landed and is flipping to 1.

If they sent the marbles down slowly and waited until each either stopped or dropped, then your explanation would work.

3

u/Orleanian Sep 30 '18

Thank God you put this in words. It was driving me crazy that I didn't actually think this was counting in binary.

But I'm a little drunk, so I couldn't be sure that I wasn't just crazy.

It's neato looking, but it turns my math boner rather flaccid.

2

u/infanticide_holiday Sep 30 '18

Exactly it. They really need to slow down the balls for this to work.

1

u/UrDeAdPuPpYbOnEr Sep 30 '18

Would a little home model be something I could make easy(ish)?

0

u/[deleted] Sep 30 '18

[deleted]

48

u/[deleted] Sep 30 '18 edited Sep 30 '18

I understand binary perfectly fine and still found the gif confusing.

10

u/severe_neuropathy Sep 30 '18

I thought it was a cool enough way to visualize counting to 10000.

3

u/Dudwithacake Sep 30 '18

That's what I thought too. Made me double take for a sec.

11

u/mcpat21 Sep 30 '18

Yeah I’m totally fine with not understanding binary

7

u/[deleted] Sep 30 '18

There are only 10 types of people in the world, people who know binary and people who don't.

3

u/[deleted] Sep 30 '18

See, that’s exactly the sort of joke I don’t get.

2

u/km89 Sep 30 '18

Binary is base 2.

The normal number system is a positional number system, just like binary. The system everyone's familiar with uses powers of 10 in its positions; that is, 1 = 1 * 100 , 10=1 * 101 , 100 = 1 * 102 , etc.

Binary uses powers of 2 instead. So instead of counting between 0 and 9 before rolling over, you count between 0 and 1.

So, 0 = 0. 1 = 1. 10 = 2, 11 = 3. 100 = 4, 101 = 5, 110 = 6, and 111 = 7. 1000 = 8, etc.

So the joke is that "10" in binary is the same thing as 2 in base-10.

See /u/pandymic's post further down the thread for a very useful video.

2

u/[deleted] Sep 30 '18

Ah, I think I get it now. Thanks for attempting to explain it to me. As for the rest, I failed high-school mathematics so I’m afraid I’m a lost cause...

2

u/pandymic Oct 01 '18

Thanks for the shoutout! My comment with original video:

https://www.reddit.com/r/educationalgifs/comments/9k5yh3/z/e6wqmfe

Original Reddit post three weeks ago, reposted by /u/MarquisDan in the comments further down:

https://www.reddit.com/r/educationalgifs/comments/9d7lh7/how_to_teach_binary_to_children

1

u/djdokk Sep 30 '18

and those who realize the joke is in ternary

2

u/Boop2133 Sep 30 '18

Well... there’s 10 types of people in this world. Those who understand binary and those who don’t.

1

u/nazenko Sep 30 '18

I feel like I got blue-ball’d by the blue ball

0

u/[deleted] Sep 30 '18

[deleted]

4

u/[deleted] Sep 30 '18

That and the timing for the next ball is constant, but the time for the ball to hit the final marker increases. Trying to follow the count makes it clear that it doesn't even count properly