Question

In: Advanced Math

A number is a Universal Product Code (UPC) if its last digit agrees with the following...

A number is a Universal Product Code (UPC) if its last digit agrees with the following computations:

• The sum of the odd position digits (not including the last) is M. That is we add the first digit to the third digit to the fifth digit etc.

• The sum of the even position digits (not including the last) is N. •

c = (3M + N)%10.

• If c = 0 then the check digit is 0.

• If c 6= 0, then the check digit is 10 − c.

(a) Check whenever 1928467 is a UPC.

(b) Suppose you are given a 7 digit number which is a UPC. Prove that if a mistake is made when scanning the number, causing one digit to be read incorrectly, then you will be able to tell that an error has been made. Hint: use results from question 2.

(c) Find an example of two 7-digit UPCs that have equal last digits, and disagree with each other at exactly two of the other digits numbers.

An example with number 1231242.

1) you add all odd-positioned digits except the last one:

M=1+3+2=6

2) add all even positioned digits not including the last one:

N=2+1+4=7

3) c=(3M+N)%10=(6*3+7)%10=5

4) the check digit is 10-5=5

So 1231242 is not an UPC.

However if we change the last digit to be 5, then it will be UPC. That is 1231245 is a UPC

Solutions

Expert Solution


Related Solutions

Credit Card Number Check. The last digit of a credit card number is the check digit,...
Credit Card Number Check. The last digit of a credit card number is the check digit, which protects against transcription errors such as error in a single digit or switching two digits. The following method is used to verify actual credit card number but, for simplicity, we will describe it for numbers with 8 digits instead of 16: Starting from the rightmost digit, form the sum of every other digit. For example, if the credit card number is 43589795, then...
Credit Card Number Check. The last digit of a credit card number is the check digit,...
Credit Card Number Check. The last digit of a credit card number is the check digit, which protects against transcription errors such as an error in a single digit or switching two digits. The following method is used to verify actual credit card numbers but, for simplicity, we will describe it for numbers with 8 digits instead of 16: • Starting from the rightmost digit, form the sum of every other digit. For example, if the credit card number is...
Java Code!!!! A five-digit number is said to be friendly if: the leftmost digit is divisible...
Java Code!!!! A five-digit number is said to be friendly if: the leftmost digit is divisible by 1 and the leftmost two digits are divisible by 2 and the leftmost 3 digits are divisible by 3 and the leftmost 4 digits are divisible by 4 and leftmost 5 digits (the five-digit number itself) is divisible by 5. For example, the number 42325 is a friendly number: 4 is divisible by 1 and 42 is divisible by 2 and 423 is...
The last digit of a credit card number is the check digit, which protects against transcription...
The last digit of a credit card number is the check digit, which protects against transcription errors such as an error in a single digit or switching two digits. The following method is used to verify actual credit card numbers but, for simplicity, we will describe it for numbers with 8 digits instead of 16: 1.) Starting from the rightmost digit, form the sum of every other digit. For example, if the credit card number is 4358 9795, then you...
what is the best code to construct a C++ program that finds a five digit number;...
what is the best code to construct a C++ program that finds a five digit number; This number should reverses the order of its digits when multiplied by four. Also, how many five digits numbers are there in which the sum of the digits is even.
The number 52430 is a 5-digit number whereas 03201 is not a 5-digit number. Determine the...
The number 52430 is a 5-digit number whereas 03201 is not a 5-digit number. Determine the number of 5-digit multiples of 5 that can be created using the digits 0 to 9, if digits may not be repeated
What is the last digit of 123456789012345678×609 in base 6. Don’t try to compute the product.
What is the last digit of 123456789012345678×609 in base 6. Don’t try to compute the product.
write a java code, please do not use method and demo Consider a four digit number...
write a java code, please do not use method and demo Consider a four digit number such as 6587. Split it at two digits, as 65 and 87. Sum of 65 and 87 is 152. Sum of the digits of 152 is 8. Given the starting and ending four digit numbers and a given target number such as 10, write a program to compute and print the number of instances where the sum of digits equals the target.
​​​​​​​ASAP PLEASE Write a python code that prompts a user to input a 10-digit phone number....
​​​​​​​ASAP PLEASE Write a python code that prompts a user to input a 10-digit phone number. The output of your code is the phone number’s  area code, prefix and line number separated with a space on a single line e.g INPUT 2022745512 OUTPUT 202 274 5512 write a code that will prompt a user to input 5 integers and output its largest value. PYTHON e.g INPUT 2 4 6 1 3 OUTPUT Largest value is: 6
Gather three close friends and conduct this simple experiment. Mention a 10-digit code number and allow...
Gather three close friends and conduct this simple experiment. Mention a 10-digit code number and allow them to memorize in 5 minutes. After five minutes let each person mention the 10-digit code number. Repeat experiment and let each person mention the code after 20 minutes i) what were your observations? Explain how this relate to short-term memory span in human beings.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT