This problem is a simplified version of the International Standard Book Number (
ID: 3852801 • Letter: T
Question
This problem is a simplified version of the International Standard Book Number (ISBN) system for identifying books. Suppose you have a 5-digit ID number system that works as follows: The first four digits (going from left to right) can he any digit from 1 to 9. The last (rightmost) digit is used as a "check digit." If you have a 5-digit ID number d_ld_2d_3d_4d_5, then the last digit d_5 is calculated as d_s = (d_1 + 2d_2 + 3d_3 + 4d_4) mod 7. For example, if the first four digits of the ID number were 5, 4, 8, and 2, then the check digit would be calculated as (5 + 2 * 4 + 3 * 8 + 4 * 2) mod 7 = 45 mod 7 = 3. a. In the above example, the 5-digit ID number would be written as 54823. Suppose that this number were mistakenly copied as 45823. Show that this results in an inconsistent check. digit. (Just work out the math yourself - no need to write any code here.)Explanation / Answer
We have 45823
so
d1 = 4
d2 = 5
d3 = 8
d4 = 2
d5 = 3
So d5 should be
(d1 + 2d2 + 3d3 + 4d4) mod 7
or (4 + 2*5 + 3*8 + 4*2) mod 7
or (4 + 10 + 24 + 8) mod 7
or (46) mod 7
or 4
but we have d5 = 3
so inconsistency
I hope this is what you want. Let me know if you need anything more.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.