CS 064 Division Mod and Bases

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

The decimal expansion of (1 1000)2 is

1×24+1×23+0×22+0×21+0×20=16+8+0+0=24

Identify the quotient and remainder when: -111 is divided by 11.

(-11, 10), let a be an integer and d a positive integer. Then there are unique integers q and r, with 0 ≤ r < d, such that a = dq + r. When −111 is divided by 11, 11 goes into −111 only 11 times, creating −121 and a remainder of 10: −111 = −11 × 11 + 10. Therefore, the quotient and remainder are −11 and 10, respectively.

Identify the quotient and remainder when: 19 is divided by 7.

(2,5), let a be an integer and d a positive integer. Then there are unique integers q and r, with 0 ≤ r < d, such that a = dq + r. When 19 is divided by 7, 7 goes into 19 only 2 times, creating 14 and a remainder of 5: 19 = 2 × 7 + 5. Therefore, the quotient and remainder are 2 and 5, respectively.

Identify the quotient and remainder when: 1000 is divided by 13.

(76, 12), let a be an integer and d a positive integer. Then there are unique integers q and r, with 0 ≤ r < d, such that a = dq + r. When 1000 is divided by 13, 13 goes into 1000 only 76 times, creating 988 and a remainder of 12: 1000 = 76 × 13 + 12. Therefore, the quotient and remainder are 76 and 12, respectively.

Identify the integers that are congruent to 5 modulo 15.

-25 - 5 = -30 is divisible by 15, hence, -25 is congruent to 5 modulo 15. 65 - 5 = 60 is divisible by 15, hence, 65 is congruent to 5 modulo 15.

The decimal expansion of (11 1011 0101)2 is

1 × 29 + 1 × 28 + 1 × 27 + 0 × 26 + 1 × 25 + 1 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = 512 + 256 + 128 + 32 + 16 + 4 + 1 = 949

The sum of the numbers (763)8 and (147)8 is _______ and their product is _____

We can just add the corresponding columns of each base 8 digit starting from the rightmost digit. Then, we get (3)8 + (7)8 = (12)8 and (6)8 + (4)8 = (12)8. When a digit-by-digit answer is too large to fit, for example, 1 + 7 = 10, we carry "1" to the next column. We find the octal product of two octal numbers as we find the product of two decimal numbers. We multiply the multiplicand by each bit of the multiplier and add the partial products. (763)8 ⋅ (7)8 = (6645)8, (763)8 ⋅ (40)8 = (37140)8, and (763)8 ⋅ (100)8 = (76300)8 So, (763)8 ⋅ (147)8 = (6645)8 + (37140)8 + (76300)8. Therefore, (763)8 + (147)8 = (1132)8 and (763)8 ⋅ (147)8 = (144305)8.

The sum of the numbers (100 0111)2 and (111 1001)2 is ________ and their product is _________

We can just add the corresponding columns of each binary digit starting from the rightmost digit. We obtain the following results when we add the digits of base 2: 0 + 0 = 0, 0 + 1 = 1 + 0 = 1 We find the binary product of two binary numbers as we find the product of two decimal numbers. We multiply the multiplicand by each bit of the multiplier and add the partial products. (100 0111)2 + (111 1001)2 = (1100 0000)2 and (100 0111)2 ⋅ (111 1001)2 = (10 0001 1000 1111)2.

Identify the correct step to prove that if a is an integer other than 0, then 1 divides a.

If a and b are integers with a ≠ 0, we say that a divides b if there is an integer c such that b=ac. 1 | a since a = 1 • a

Prove that if a | b and b | a, where a and b are integers, then a = b or a = −b.

If a | b and b | a, there are integers c and d such that b = ac and a = bd. Hence, a = acd. Because a ≠ 0 it follows that cd = 1. Thus either c = d = 1 or c = d = −1. Hence, either a = b or a = −b.

Evaluate these quantities: 138 mod 7 =

Since 138 = 7 · 19 + 5, the remainder is 5. That is, 138 mod 7 = 5.

Evaluate these quantities. 204 mod 19 =

Since 204 = 19 · 10 + 14, the remainder is 14. That is, 204 mod 19 = 14.

The binary expansion of 321 is

Since 321/2 is 160 with a remainder of 1, the rightmost digit is 1. Since 160/2 is 80 with a remainder of 0, the second digit from the right is 0. We continue in this manner, obtaining successive quotients of 40, 20, 10, 5, 2, 1, and 0 and remainders of 0, 0, 0, 0, 1, 0, and 1. Putting all these remainders in order from right to left we obtain (1 0100 0001)2 as the binary representation. We could, as a check, expand this binary numeral as 20 + 26 + 28 = 1 + 64 + 256 = 321.

Evaluate these quantities: -17 mod 2 =

Since −17 = 2 · (−9) + 1, the remainder is 1. That is, −17 mod 2 = 1.

Prove that if a | b and b | c, then a | c.

Supposed a | b and b | c. By definition of divisibility, a | b means that b = at for some integer t, and b | c means that c = bs for some integer s. We substitute the equation b = at into c = bs and get c = ats. By definition of divisibility, c = a(ts), with ts being an integer, implies a | c.

The binary expansion of 1023 is

The binary representation is 1 less than (100 0000 0000)2 , which is (11 1111 1111)2.

List five integers that are congruent to 4 modulo 13:

The integers that are congruent to 4 modulo 13 are the ones that leave a remainder 4 when divided by 13. So, the numbers are 4, 30, 56, 82, and 108.

The hexadecimal notation of (1000 1000 1000 1000)2 is

To convert (1000 1000 1000 1000)2 into hexadecimal notation, group the binary digits into blocks of four, adding initial zeros at the start of the leftmost block if necessary. Each block is 1000, which corresponds to the hexadecimal digit 8. Consequently, (1000 1000 1000 1000)2 = (8888)16.

The hexadecimal notation of (1111 1001)2 is

To convert (1111 1001)2 into hexadecimal notation, group the binary digits into blocks of four, adding initial zeros at the start of the leftmost block if necessary. These blocks, from left to right, are 1111 and 1001, corresponding to the hexadecimal digits F and 9, respectively. Consequently, (1111 1001)2 = (F9)16.

The binary expansion of (135AB)16 is

To convert (135AB)16 into binary notation, we are only dropping the initial 0's of the first block. These blocks are 1, 0011, 0101, 1010, and 1011. Hence, (135AB)16 = (1 0011 0101 1010 1011)2.

The binary expansion of (80E)16 is

To convert (80E)16 into binary notation, we replace each hexadecimal digit by a block of four binary digits.These blocks are 1000, 0000, and 1110. Hence, (80E)16 = (1000 0000 1110)2.

The sum of the numbers (1AE)16 and (BBE)16 is _______ and their product is _______

We can just add the corresponding columns of each base 16 digit starting from the rightmost digit. Then, we get (E)16 + (E)16 = (1C)16, (A)16 + (B)16 = (15)16, and (1)16 + (B)16 = (C)16. When a digit-by-digit answer is too large to fit, for example, 1 + F = 10, we carry "1" to the next column. We find the hexadecimal product of two hexadecimal numbers as we find the product of two decimal numbers. We multiply the multiplicand by each bit of the multiplier and add the partial products. (1AE)16 ⋅ (E)16 = (1784)16, (1AE)16 ⋅ (B0)16 = (127A0)16, and (1AE)16 ⋅ (B00)16 = (127A00)16 So, (1AE)16 ⋅ (BBE)16 = (1784)16 + (127A0)16 + (127A00)16. Therefore, (1AE)16+ (BBE)16= (D6C)16and (1AE)16⋅ (BBE)16= (13B924)16.


Ensembles d'études connexes

Normal pregnancy and prenatal care

View Set

Fundamentals of Biology HW Set #2

View Set