I am struggling with the topic of converting a number to a base 5....
Tried looking some stuff up but still confused
The one example I have on my homework is 79 to base 5
I am struggling with the topic of converting a number to a base 5....
Tried looking some stuff up but still confused
The one example I have on my homework is 79 to base 5
On
Just find the remainder of division by 5, taking the positive or negative remainder, at each steps :
Thus in base 5, 79 is 304
As $3*5^2+0*5^1+4*5^0 = 79$
On
To convert a number $n$ to any base divide $n$ by the base to get both the quotient and remainder. The remainder becomes the rightmost digit in the representation and if the quotient is greater than or equal to the base we divide again to get the next digit, etc.
Let's convert $100$ to base $7$ as an example. If we divide $100$ by $7$ we get a quotient of $14$ and a remainder of $2$. This makes $2$ the right most digit.
Is $14\lt 7$? No so we divide $14$ by $7$ to get a quotient of $2$ and a remainder of $0$. The $0$ becomes the next digit (to the left of our first one) and we again evaluate the quotient.
Is $2\lt 7$? Yes so $2$ becomes our last digit and we get $100=202_7$.
On
The first thing to understand when converting a number from base 10 ($x_{10}$) to any given base $b$ is that the number in base 10 is equal to a weighted sum of powers of the base, $x_{10}=a_0b^{0}+a_1b^{1}+\dots+a_nb^{n}$. So to convert $79_{10}$ to base 5 you need to find the $a_i$. You can find them by dividing the number in base 10 by the base over and over again, until division do not result in a integer quotient and then taking the remainder and the last quotient in the inverse order.
So \begin{array}{r|r} 79&5\\ \hline \color{red}4&15 \end{array} \begin{array}{r|r} 15&5\\ \hline \color{red} 0&\color{red}3 \end{array} $79_{10}=304_{5}=4 \cdot 5^0+0\cdot5^1+3\cdot5^2=4+3\cdot25=4+75=79$
On
$5^0 = 1 < 79, 5^1=5 < 79, 5^2 = 25 < 79; 5^3 = 125 > 79$.
So $5^2 < 79 < 5^3$.
So that's it. $79 = a\times 5^2 +b\times 5 + c$ for some values of $a,b,c$ and $79$ will have $3$ digits in base $5$.
$79\div 25 = 3$ with $4$ remainder. That is $79 = 3*25 + 4$.
So the first digit is $3$. And we have $79 = 3*5^2 + b*5 + c$. We need to find the next two digits.
Do the so for the next lower power of $5$. We found out the digit for $5^2$ place so now we must do the some for the $5^1$ place. So we take the remainder of $4$ and ask ourselves:
What times $5=5^0$ will equal $4$, and what will be the remainder?
The answer to that, and this is probably what is confusing you, $4< 5$ so we must have $0* 5^1$. In other words $4\div 5 = 0$ with $4$ remainder. So the second digit is $0$. And we have $79 = 3*5^2 + 0*5^1 + c$. We must find the last digit.
Well, this is trivial. $4\div 1 = 4$ with zero remainder. So last digit is $4$ and we have $79 = 3*5^2 + 0*5^1 + 4$.
The verify $304_5 = 3*5^2 + 0*5^1 + 4*5^0 = 3*25 + 0*5 + 4*1 = 75+4 = 79$.
That's it.
The basic procedure to convert a number a to base b is by continuous division.
We display each remainder from right to left.
End of process.
Displaying the remainders from bottom to top:
$79_{base 10} = 304_{base 5}$