Question about the remainder of a division

In summary: This will allow you to work with numbers instead of bitstrings.In summary, the problem states that for any positive integers a and b, the remainder when (2^a-1) is divided by (2^b-1) is equal to (2^{a mod b}-1). The solution provided splits the problem into three cases and shows that the theorem holds for each case. It is then questioned if there is a more rigorous way of proving this, and it is suggested to exchange the bitstrings with sums to work with numbers instead.
  • #1
pc2-brazil
205
3
I was self-studying Discrete Mathematics and I found the following problem.

Homework Statement
Show that whenever a and b are positive integers, then
[tex](2^a-1)\mod(2^b-1)=2^{a\mod b}-1[/tex]

The attempt at a solution
I don't know if there is a more rigorous way of solving it, but I came up with the following solution:
I will split it in three cases: [itex]a=b[/itex], [itex]a<b[/itex] and [itex]a>b[/itex].
If a = b, the remainder is zero, and [itex]2^{a\mod b}-1[/itex]=[itex]2^0-1=0[/itex], confirming the theorem for this case.
If [itex]a<b[/itex]:
Because [itex]a<b[/itex], [itex]2^a-1<2^b-1[/itex], therefore
[tex](2^a-1)\mod(2^b-1)=2^{a}-1=2^{a\mod b}-1[/tex]
If [itex]a>b[/itex]:
The numbers [itex]2^a-1[/itex] and [itex]2^b-1[/itex] are the decimal equivalents of the largest binary (base 2) numbers which can be written with a and b digits, respectively. Thus, these bitstrings (binary numbers) will contain only '1's as their digits.
The remainder of the division of the bitstrings consisting of only a and b '1's, with [itex]a>b[/itex], will be the largest bitstring with [itex]a\mod b[/itex] digits (a bitstring consisting of only [itex]a\mod b[/itex] '1's).
This is true because, if we take the number with a '1's and subtract from it the bitstring with [itex]a\mod b[/itex] '1's, the result will be a number with a digits, beginning with b '1's and ending with [itex]a\mod b[/itex] zeroes. Therefore, this result will be divisible by b, and the remainder will be the bitstring with [itex]a\mod b[/itex] '1's.
So, the decimal representation of this remainder is [itex]2^{a\mod b}-1[/itex], confirming that
[tex](2^a-1)\mod(2^b-1)=2^{a\mod b}-1[/tex]

Is there a more rigorous way of showing this?

Thank you in advance.
 
Last edited:
Physics news on Phys.org
  • #2
Hi pc2-brazil! :smile:

pc2-brazil said:
I was self-studying Discrete Mathematics and I found the following problem.

Homework Statement
Show that whenever a and b are positive integers, then
[tex](2^a-1)\mod(2^b-1)=2^{a\mod b}-1[/tex]

The attempt at a solution
I don't know if there is a more rigorous way of solving it, but I came up with the following solution:
I will split it in three cases: [itex]a=b[/itex], [itex]a<b[/itex] and [itex]a>b[/itex].
If a = b, the remainder is zero, and [itex]2^{a\mod b}-1[/itex]=[itex]2^0-1=0[/itex], confirming the theorem for this case.
If [itex]a<b[/itex]:
Because [itex]a<b[/itex], [itex]2^a-1<2^b-1[/itex], therefore
[tex](2^a-1)\mod(2^b-1)=2^{a}-1=2^{a\mod b}-1[/tex]
If [itex]a>b[/itex]:
The numbers [itex]2^a-1[/itex] and [itex]2^b-1[/itex] are the decimal equivalents of the largest binary (base 2) numbers which can be written with a and b digits, respectively. Thus, these bitstrings (binary numbers) will contain only '1's as their digits.
The remainder of the division of the bitstrings consisting of only a and b '1's, with [itex]a>b[/itex], will be the largest bitstring with [itex]a\mod b[/itex] digits (a bitstring consisting of only [itex]a\mod b[/itex] '1's).
This is true because, if we take the number with a '1's and subtract from it the bitstring with [itex]a\mod b[/itex] '1's, the result will be a number with a digits, beginning with b '1's and ending with [itex]a\mod b[/itex] zeroes. Therefore, this result will be divisible by b, and the remainder will be the bitstring with [itex]a\mod b[/itex] '1's.
So, the decimal representation of this remainder is [itex]2^{a\mod b}-1[/itex], confirming that
[tex](2^a-1)\mod(2^b-1)=2^{a\mod b}-1[/tex]

Is there a more rigorous way of showing this?

Thank you in advance.

Indeed, working with bitstrings isn't the most rigorous thing around. But there's a very easy way to make this thing rigorous. Just exchange the bitstring with a sum. For example

[tex]11001=2^5+2^4+1~\text{and}~111111=2^6+2^5+2^4+2^3+2^2+2+1[/tex]

So just exchange each occurence of the bitstring with such a sum.
 

Related to Question about the remainder of a division

1. What is the remainder of a division?

The remainder of a division, also known as the modulus, is the amount left over after dividing one number by another. It is the number that cannot be evenly divided or multiplied to get a whole number.

2. How is the remainder calculated in a division?

The remainder in a division is calculated by dividing the dividend (the number being divided) by the divisor (the number doing the dividing). The remainder is the amount left over after the division is complete.

3. Can the remainder be a decimal or a fraction?

No, the remainder in a division can only be a whole number. If there is a remainder that is a decimal or a fraction, it is typically rounded down to the nearest whole number.

4. What is the purpose of calculating the remainder in a division?

Calculating the remainder in a division can be useful in solving real-life problems, such as determining how many groups of items can be made with a certain number of items, or finding the smallest common multiple of two numbers.

5. Are there any shortcuts or tricks for finding the remainder in a division?

Yes, there are some shortcuts that can be used to quickly find the remainder in a division. For example, if the divisor is a multiple of 10, you can look at the last digit of the dividend to determine the remainder. If the last digit is 0, 2, 4, 6, or 8, the remainder will be 0. If the last digit is 1, 3, 5, 7, or 9, the remainder will be 1. Additionally, if the divisor is a factor of the dividend, the remainder will be 0.

Similar threads

  • Calculus and Beyond Homework Help
Replies
11
Views
1K
  • Calculus and Beyond Homework Help
Replies
16
Views
2K
Replies
11
Views
662
  • Calculus and Beyond Homework Help
Replies
32
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
608
Replies
4
Views
425
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
576
  • Calculus and Beyond Homework Help
Replies
3
Views
861
Back
Top