Podcast on Arithmetic in Different Number Bases

Arithmetic in Different Number Bases: A Student Guide

Podcast

Číselné soustavy0:00 / 21:23
0:001:00 zbývá
DanVětšina lidí si myslí, že číslo deset má nějakou zvláštní, magickou matematickou moc. Ale ve skutečnosti... je to jen proto, že máme deset prstů.
SophiePřesně tak! Je to úplně nejpřirozenější způsob, jak jsme se jako lidstvo naučili počítat. Vítejte u Studyfi Podcast.
Chapters

Číselné soustavy

Délka: 21 minut

Kapitoly

Mýtus o desítce

Jak funguje poziční soustava

Jiné základy, jiná pravidla

Převod do naší soustavy

Zpátky do cizí soustavy

Addition in Any Base

Multiplication and Division

The Conversion Shortcut

Bridging Bits and Bytes

Addition in Binary

Beyond Binary

Borrowing in Other Bases

A Quick Look at Multiplication

Final Thoughts

Přepis

Dan: Většina lidí si myslí, že číslo deset má nějakou zvláštní, magickou matematickou moc. Ale ve skutečnosti... je to jen proto, že máme deset prstů.

Sophie: Přesně tak! Je to úplně nejpřirozenější způsob, jak jsme se jako lidstvo naučili počítat. Vítejte u Studyfi Podcast.

Dan: Takže... kdybychom byli kreslené postavičky se čtyřmi prsty na každé ruce, používali bychom osmičkovou soustavu?

Sophie: Velmi pravděpodobně! A celý náš svět čísel by vypadal jinak. To je přesně to, o čem jsou poziční číselné soustavy.

Dan: Dobře, co přesně znamená „poziční“? Zní to trochu... složitě.

Sophie: Vůbec ne. Jen to znamená, že hodnota každé číslice závisí na její pozici v čísle. Vezmi si třeba číslo 5 706.

Dan: Jasně, pět tisíc sedm set šest.

Sophie: Přesně. Ta pětka neznamená jen „pět“, ale „pět tisíc“, protože je na pozici tisíců. Sedmička znamená „sedm set“ a tak dále. Můžeme to rozepsat jako 5 krát 10 na třetí, plus 7 krát 10 na druhou... a tak dál.

Dan: Aha! A ta desítka je ten náš „základ“, protože máme deset prstů, tedy deset číslic od nuly po devítku.

Sophie: Přesně tak! A to je celý princip. Základem soustavy, označujeme ho „z“, může být jakékoliv přirozené číslo větší než jedna.

Dan: Takže co když základ není deset? Třeba ta slavná dvojková soustava v počítačích?

Sophie: Skvělý příklad. Dvojková soustava má základ 2. To znamená, že používá jen dvě číslice: 0 a 1. A všechno se počítá v mocninách dvojky, ne desítky.

Dan: A co když je základ větší než deset? Třeba dvanáct? Dojdou nám číslice.

Sophie: Přesně! Proto si vypomáháme písmeny. V šestnáctkové soustavě, která je super důležitá v programování, máme číslice 0 až 9, a pak A pro desítku, B pro jedenáctku, až po F pro patnáctku.

Dan: Takže moje heslo k počítači může být vlastně obrovské číslo. To je skvělé!

Sophie: Může! Ještě jedna důležitá věc — jak ta čísla čteme. Číslo 159 v naší desítkové soustavě přečteš „sto padesát devět“. Ale třeba číslo 154 v šestkové soustavě musíš číst „jedna, pět, čtyři v šestkové soustavě“.

Dan: Abychom věděli, že nemluvíme o stovkách, ale o jednotlivých číslicích. Chápu.

Sophie: A teď to nejlepší — převody. Je to jako překládat z jednoho jazyka do druhého. Jak bychom třeba převedli číslo 2012 ze trojkové soustavy do naší desítkové?

Dan: Hmm, hádám, že použijeme ten rozvoj, o kterém jsi mluvila, ale s mocninami trojky místo desítky?

Sophie: Jsi na správné stopě! Vezmeme každou číslici a vynásobíme ji mocninou základu, tedy trojky, podle její pozice. Začínáme zprava s mocninou na nultou.

Dan: Dobře, takže... 2 krát 3 na nultou, plus 1 krát 3 na první, plus 0 krát 3 na druhou... plus 2 krát 3 na třetí?

Sophie: Perfektní! A když to sečteš, dostaneš 59. Takže 2012 v trojkové soustavě je to samé jako 59 v naší desítkové.

Dan: A jde to i naopak? Třeba převést naše číslo 85 do dvojkové soustavy?

Sophie: Jasně. Musíme najít nejvyšší mocninu dvojky, která je menší nebo rovna 85.

Dan: Takže... dva na šestou je 64. Dva na sedmou je 128, to už je moc. Takže začneme s 64.

Sophie: Přesně. Takže na pozici 2 na šestou bude jednička. Teď odečteme 64 od 85. Zbyde nám 21.

Dan: A teď hledáme nejvyšší mocninu dvojky, která se vejde do 21... to je 16, což je 2 na čtvrtou.

Sophie: Super! Takže na pozici 2 na čtvrtou bude jednička. A co pozice mezi nimi, 2 na pátou? Ta se tam nevešla, takže tam bude...?

Dan: Nula! Jasně! A takhle pokračujeme, dokud se nedostaneme na nulu. To je vlastně docela logické.

Sophie: Vidíš? Žádná magie, jen prsty a mocniny. A přesně na tenhle postup se podíváme podrobněji.

Dan: ...so it really is just about grouping things differently. Okay, my brain has accepted that. But Sophie, that brings up a huge question. If the numbers look different, how on earth do you do math with them?

Sophie: That is the million-dollar question, Dan! And it's where things get really fun. You don't have to convert everything back to base 10 just to add two numbers together.

Dan: Wait, really? You can just... do math in binary? Or base six?

Sophie: You absolutely can. The methods are almost identical to what you learned in primary school. The only thing that changes is the 'carry the one' rule.

Dan: Okay, you have my full attention. What do you mean the rule changes?

Sophie: Think about our normal base 10. When you add 8 plus 5, you get 13. What you're really doing is writing down the 3 and 'carrying' a group of 10 over to the next column, right?

Dan: Yeah, you carry the one. I remember that.

Sophie: Exactly. In another base, you do the same thing... you just carry over at a different number. Let me give you an example. Let's work in base six.

Dan: Base six... so the only digits I can use are 0, 1, 2, 3, 4, and 5. Got it.

Sophie: Perfect. Now, what do you think 4 plus 3 is in base six?

Dan: Uh... seven? But seven isn't a digit in base six. Oh, I see the problem.

Sophie: You've got it! Since there's no '7', you have to regroup. 4 plus 3 is one group of six, with one left over. So, we write it as 'one-zero'... no, wait, 'one-one'. One-one base six.

Dan: Whoa. So 4 + 3 = 11 in base six! My head is spinning, but in a good way.

Sophie: It feels weird, but the logic is the same. To make it easier, you can even draw a little addition table, just like you did for base 10 when you were a kid. For base six, the table shows that 5 + 1 is 10, 5 + 2 is 11, and so on.

Dan: So if I were adding, say, 12345 in base six to another number, I'd just use those rules for each column?

Sophie: That's the key takeaway. You add column by column, and anytime the sum hits six or more, you carry a new group of six over to the next column. It works for any base.

Dan: Okay, if addition works, I'm guessing multiplication does too? Is it the same deal?

Sophie: It is. You use a multiplication table for that base. So in base six, 3 times 3 isn't 9... it's 'one-three' base six, because 9 is one group of six and three left over. You just follow the same long multiplication algorithm you already know.

Dan: Alright, I can wrap my head around that. But... division? Long division was hard enough in base 10!

Sophie: I know, I know. But again, the process is identical. It just feels strange. Let's say you're dividing 12345 by 5... all in base six.

Dan: Don't do this to me...

Sophie: Stay with me! You'd ask, 'how many times does 5 go into 12 base six?' You'd look at your base six multiplication table for the number 5. You'd see that 1 times 5 is 5, and 2 times 5 is 14 base six... which is too big.

Dan: So the answer is 1. Just like regular long division. You write down the 1, multiply, then subtract.

Sophie: Exactly! You just have to do your subtraction using base six rules as well. It's all self-contained within that number system. It's like learning the grammar of a new language.

Dan: So if I wanted to convert a number from, say, binary to base eight, would I have to convert it to base 10 first and then to base eight? That seems like a lot of steps.

Sophie: That's the standard way, and it always works. But here's the surprising part... there's a shortcut. A really elegant one, but only for certain bases.

Dan: A math shortcut? I'm all ears. What's the secret?

Sophie: The trick works when one base is a power of the other. For instance, eight is two to the power of three. And sixteen is two to the power of four.

Dan: Okay... so how does that help?

Sophie: Because eight is two-cubed, you can convert from binary to base eight by grouping the binary digits into sets of three, starting from the right.

Dan: You're kidding. You just... group them?

Sophie: You just group them! Let's take a binary number like 101110. You split it into two groups of three: 101 and 110. Then you just convert each little group into its base 10 equivalent.

Dan: So... 101 in binary is 5. And 110 is 6. So... the number is just... 56 in base eight?

Sophie: That's it! 101110 in binary is 56 in octal. No middle step through base 10 needed. It works the other way too. To go from base eight to binary, you just convert each digit into its three-digit binary equivalent.

Dan: That is genuinely cool. And it works for hexadecimal too? Base 16?

Sophie: Yep! Since 16 is 2 to the power of four, you'd group the binary digits into sets of four. It's an incredibly powerful tool used all the time in computing to make long binary strings easier for humans to read.

Dan: Wow. So hexadecimal isn't just random letters and numbers, it's literally just a shorthand for binary.

Sophie: Precisely. Every hex digit corresponds directly to a four-digit binary chunk. That's why computer scientists and programmers use it so much. It's a much more compact and human-friendly way to represent the raw ones and zeros the computer is actually using.

Dan: It connects the low-level machine language with something a person can actually type and understand. That makes so much sense now.

Sophie: Exactly. It's the bridge between how computers 'think' and how we work with them. So while it seems abstract, it has incredibly practical applications.

Dan: So to recap... we can perform all our normal arithmetic—adding, subtracting, multiplying, dividing—in any base we want, as long as we follow the rules for that base's 'carry over'.

Sophie: You've got it. And for converting between bases that are powers of each other, like binary and hexadecimal, we can use a simple grouping trick to do it instantly.

Dan: Fantastic. This actually makes the world of computing feel a lot less mysterious. But it does make me wonder about what other kinds of numbers are out there, beyond these simple integers we've been grouping.

Dan: So, that's how we translate numbers between different systems. It's wild to think that a number like 54 can also be written as 110110 in binary. But... what's the point? Can you actually do math with these other numbers?

Sophie: That is the million-dollar question, Dan! And the answer is absolutely yes. It's not just for show. Computers are doing math in binary billions of times a second. The principles are exactly the same as the math you learned in elementary school.

Dan: I'm not sure if that's reassuring or terrifying. I still have nightmares about long division.

Sophie: Well, let's stick with addition for now. It's much friendlier.

Dan: Okay, so how does it work? If I want to add two binary numbers, say... one-one-zero-zero-one-one and one-zero-one-zero-one?

Sophie: Great example. That's 110011 and 10101 in base two. The first thing we need is a super simple addition table for binary. It's tiny. Zero plus zero is zero. Zero plus one is one. One plus zero is one.

Dan: So far, so good. No surprises there.

Sophie: Here's the only tricky part. One plus one is... two. But we can't write '2' in binary. What's the number two in binary?

Dan: Oh, right! From before... it's 'one-zero'. So, 10.

Sophie: Exactly. So, in binary, one plus one equals one-zero. That means you write down the zero and carry the one over to the next column. Just like carrying a ten in our normal system.

Dan: Ah, okay. The 'carry the one' rule still applies. It's just a 'carry the two' now, sort of.

Sophie: You've got it! So let's add your numbers. We line them up just like a normal sum. Starting from the right: one plus one is one-zero. We write zero, carry the one. Next column: we have one plus zero, plus the one we carried. That's two again! So, another zero, and carry another one.

Dan: I'm following. This is like a weird domino effect.

Sophie: It is! The next column is zero plus one, plus our carried one. That's two again. So, a third zero, carry a one. Then we have zero plus zero plus the carried one... which is just one.

Dan: No carry this time. Nice.

Sophie: Exactly. The last two columns are easy: one plus one is one-zero. Write zero, carry one. And finally, the last one we carried just comes down. So the final answer is... 1001000.

Dan: Okay, that felt like a magic trick. How do we know if we're right?

Sophie: Here's the fun part. We check it using base ten. Your first number, 110011 in binary, is 51 in decimal. Your second number, 10101, is 21.

Dan: And 51 plus 21 is 72.

Sophie: Right. And if you convert our answer, 1001000, from binary back to decimal... you get 64 plus 8, which is... 72. It works perfectly.

Dan: Wow! Okay, that's actually really cool. The system is consistent. It's not just random rules.

Sophie: And it's not just for binary. This logic works for any base. Let's try adding in base three, for example. The digits are 0, 1, and 2. The 'carry' number is now three.

Dan: So... two plus one would be ten? I mean, 'one-zero' in base three?

Sophie: Precisely! So if we add, say, 201 and 122 in base three... We start on the right. One plus two is three. So we write zero and carry the one. In the middle, zero plus two plus our carried one... is three again. Another zero, another carry.

Dan: And for the last column, two plus one, plus the carried one... that's four! What do we do now?

Sophie: Good question! What's four in base three? It's one group of three, with one left over. So it's 'one-one'. We write that down at the end. The result is 1100 in base three.

Dan: It's like a puzzle. You just have to remember what number you're supposed to 'carry' at.

Sophie: That's the key takeaway. The algorithm for addition is universal. The only thing that changes is the base.

Dan: Okay, my brain is wrapping around addition. But what about subtraction? I remember my teacher talking about 'borrowing' from the next column.

Sophie: It's the exact same idea. In base ten, when you borrow, you're borrowing a ten. In base two, you borrow a two. In base four, you'd borrow a four. Let's do a quick one in base four. Imagine we have 2330 and we need to subtract 103.

Dan: Alright, let's try. Starting on the right: zero minus three. Can't do it. So I need to borrow from the next column, the '3'.

Sophie: Yep. You're borrowing a 'four' from that column. So that '3' becomes a '2', and your '0' becomes a '4'.

Dan: So now it's four minus three, which is one. The next column is now two minus zero, which is two. Then three minus one is two. And the last two just comes down. So... 2221 in base four?

Sophie: You nailed it! See? The process feels familiar, even though the numbers look strange. The method doesn't change, just the value you borrow.

Dan: This is making sense. I'm almost afraid to ask about multiplication and division.

Sophie: Don't be! It's the same pattern. Think about how you do long multiplication. You use your multiplication tables, from one-times-one up to nine-times-nine.

Dan: Right, which I definitely have memorized. Definitely.

Sophie: Well, to multiply in another base, you just need a multiplication table for that base. In binary, it's incredibly easy. Anything times zero is zero, and one times one is one. That's it.

Dan: Wait, really? The whole multiplication table is that small?

Sophie: It is! Which is another reason computers love binary. It makes the circuitry for multiplication much, much simpler. For other bases, you'd have a bigger table, but the process of multiplying and carrying is identical to what you do in base ten.

Dan: And I'm guessing division is the same story? A more complex version of the same idea?

Sophie: You got it. It's just repeated subtraction and uses those same base-specific multiplication facts. A bit more work, but the foundational logic is still there.

Dan: So really, all these different number systems... they aren't different sets of rules for math. They're just different ways of writing numbers down, but the deep, underlying rules of addition, subtraction, multiplication, and division are totally universal.

Sophie: That's the perfect summary, Dan. Learning arithmetic in a different base feels strange at first, but it's like learning a new language. The ideas you want to express—adding, subtracting—are the same. You're just using a different vocabulary and a different grammar to write them down.

Dan: The key is just remembering when to 'carry the one'... or the two, or the three, or whatever base you're in. It really shows how fundamental the idea of a positional number system is.

Sophie: It truly is. It's one of the most powerful inventions in human history. Simple, elegant, and it works everywhere.

Dan: Well, that's all the time we have for today. We've journeyed from ancient number systems to the binary that powers our world, and even did a little math along the way. Sophie, thank you so much for breaking this all down.

Sophie: It was my pleasure, Dan. It's a fascinating topic!

Dan: And a huge thank you to our listeners for joining us on the Studyfi Podcast. We hope you're leaving with a little more curiosity than you came with. Until next time, keep asking questions.