Professional Documents
Culture Documents
Exercise 1.1
a. (47+26) mod 15
Answer: (47+26) congruent 13(mod 15) rem 13
b. (25-32) mod 9
Answer: (25-35) congruent 0(mod 9)
c. (13)(32) mod 14
Ans: (13)(32) congruent 10(mod 14)
4. In exactly 125 days, the country will commemorate Labor Day (May 1).
For number 7 and 8, determine whether the given UPC number is valid or not. If
the number is not valid, give the correct check digit.
For numbers 9 and 10, determine whether the given credit card number is valid or
not.
Exercse 1.2
3. The assigned leaders will represent the group's output to the entire class.
UCP DIGIT
8-06502-35009-6
X¹ =8 X⁷=3
X²=0 X⁸=5
X³=6 X⁹=0
X⁴=5 X¹⁰=0
X⁵=0 X¹¹=9
X⁶=2 X¹²=6
6x¹+x²+6x³+x⁴+6x⁵+x⁶+6x⁷+x⁸+6x⁹+x¹⁰+6x¹¹+x¹²=0(mod 10)
0-00007-74778-4
6x¹+x²+6x³+x⁴+6x⁵+x⁶+6x⁷+x⁸+6x⁹+x¹⁰+6x¹¹+x¹²=0(mod 10)
6(0)+0+6(0)+0+6(0)+7+6(7)+4+6(7)+7+6(8)+4=0(mod 10)
0+0+0+0+0+7+42+4+42+7+48+4=0(mod 10)
154=0(mod 10)
Answer: Invalid
False statement: 154=0(mod 10)
*Do you think you can use the same modulus in 5-digit code?
Ans: Yes
Assignment
Watch the video clip and complete the statements that follow.
Nowadays everyone uses computer and mobile phone, but fee knew that Alan
turning was the inventor.
How intelligent people solve difficult problems.
Sometimes what human are scared of the most, is something that is smarter or
more efficient of something that isn't themselves.
Exercise 2.1
1. Determine the decimal number tht is equivalent to each of the given binary number:
a. 1001011
Answer: 75
b. 110011
Answer: 51
c. 101101
Answer: 45
a. 365
Answer: 011100001
b. 875
Answer: 1101011011
c. 1362
Answer: 01001010001
3. Find the sum:
a. 11001 b. 1011011
+ 1010 + 10011
36 76
Use the table of 5-bit codes for the letters of the alphabet to answer Problems 4
and 5.
a. 0011101111001000000000010011000010111001110011000001010001000001
010000010000010000100100110001001100001000001001011100010110011
Answer: GOD BLESS THE PHILIPPINES
b. 0110101000010101100010100000001011011000101101011001000000000100
01110100001001011110111000000000110111110101011101010010011
6. To form a Hamming code, how many additional bits and form the Hamming code?
To better understand how many additional bits in the original code. Note
that the nearest power of 2 that is less than 5 (the number of bits in the given
code) is 4 (you is 2¹) this means that you have to allocate 2+1=3 more bits
position in the given code.
7. What are the positions of the additional bits?
Answer: The position of the additional bits ? ? 1 ? 1 0 0 0 1 0 1 0 11 0 0
8. Find the values of the additional bits and form the Hamming code.
The Hamming code must then be: 1100010101100
1100010101100
solution: ??1?100010101100
p-1= ? 1 1 0
p-2= ? 1 0 0
p-4= ? 1 0 0
a. 011011
answer: 110011011
b. 100110101
answer: 001100110101
10. Suppose the following Hamming codes were created using even parity, determine if
the code is correct or not. If not correct Hamming code.
a. 000011001010 - CORRECT
Assignment
Watch the video clip and complete the statements that follow.
The Binary codes have a mathematical description behind it. When I was
thinking before I watch the video clip, I used to believe that Binary codes
don’t have any related functions in our daily lives. However, I realize that
these are products of mathematical concepts.
Exercise 3.1
1. Specify the encryption using the Shift Cipher method for the following values of K
a. K=2
C=(P+30) MOD 26
15+20= 35 MOD 26
CIPHER MESSAGES
|P |R |A |Y |F |O |R |M |A |R |A |W |I
|15|17|0|24|5|14|17|12|0 |17|0 |21| 8
ORIGINAL POSITIONS
b. K=11
C= C(P+11) MOD26
5=11 = 26 MOD 26
3. Using Affline Cipher, specify the encryption cipher for the following specified
parameters.
a. (m,K) = (7,10)
(m,K) = (7,10)
(m,k) : ( mp+k) mod26
(m,k) = (7,10)
Formula
C= (7C+10) mod26
P =21(C+10) mod26
P =21(24+10) mod26
= 21(34) mod26
714MOD26 =15
b. (m,K) = (15,8)
(m,k) = (15, 8)
(m,k) P=¹ (c,k) mod26
m
P= (15 P-8) mod26
(1 , k ) (=5-8)
m
Solution
P=5 (C-8)mod26
P= 5(24- 8) mod26
5( 16) mod26
80 mod26=15
4. Using the same parameters in Problem 3 to specify the corresponding decryption
ciper.
a. (m,k) = (7,10)
(m,k) : ( mp+k) mod26
(m,k) = (7,10)
Formula
C= (7C+10) mod26
P =21(C+10) MOD26
P =21(24+10) MOD26
= 21(34) mod26
714MOD26 =15
OM |K |I |L |L |T |H |E |B |E |A |S|T
OP |10|8|11|11|17|7 |4 |1 |4 |0 |18|19
SP|23|2|24|6|20|17|14|17|14|17|13|5|6|
EM|X|U|Y|G|U|R|O|R|N|P|G|
b. I am coming home K = 18
C=(P+12) mode 26
=15+12=24 mod 26
OM |K |I |L |L |T |H |E |B |E |A |S|T
OP |10|8|11|11|17|7 |4 |1 |4 |0 |18|19
SP|23|2|24|6|20|17|14|17|14|17|13|5|6|
EM|X|U|Y|G|U|R|O|R|N|P|G|
a. SLHCLLHYSF,K = 7
K=7
OriginalMessage
S|L|H|C|L|L|H|Y|S|F
Original Position
18|11|7|2|7|11|11|7|24|18|5
Shifted Position
25|18|14|9|18|18|14|31=5|25|12
Encrypted Message
Z|S|O|J|S|S|O|F|Z|M
b. TMPBXHTPHN, K = 15
K=15
OriginalMessage
T|M|P|B|X|H|T|P|H|N
Original Position
9|12|15|1|23|7|19|15|2
Shifted Position
34=8|27=1|30=4|16|38=12|34=8|30=4|22|28=2
Encrypted Message
I|O|E|Q|M|W|I|E|W|C
7. Apply Affine Cipher using (m, K) = (5, 21) to encrypt the following message;
Original Message
I|W|I|L|L|P|A|S|S|T|H|E|B|O|A|R|D|E|X|A|M
Original Position
8|22|8|11|11|15|0|18|18|19|7|4|11|4|0|17|3|4|23|0|12
Shifted Position
9|1|924|24|18|21|7|7|12|4|15|0|13|21|21|0|15|6|21|3
Encrypted Message
J|B|J|Y|Y|S|V|H|H|M|E|P|A|N|V|C|K|P|G|V|D
b. Go home immediately
GO HOME IMMEDIATELY
Original Message
G|O|H|O|M|E|I|M|M|E|O|I|A|T|E|L|Y
Original Position
6|14|7|14|12|4|8|12|12|4|3|8|0|4|4|11|24
Shifted Position
25|13|4|13|15|9|3|3|15|10|9|21|12|15|24|11
Encrypted Message
Z|N|E|N|O|P|J|D|D|P|K|J|V|M|P|Y|L
8. Use the same cipher parameters in Problem 7 to decrypt the following message;
a. FNDJIZHNNI
Original Message
F|N|D|J|I|Z|H|N|N|I
Original Position
5|13|3|9|8|25|7|13|13|8
Shifted Position
2|14|12|8|13|6|18|14|14|13
b. MVTPVACPPVT
Original Message
M|V|T|P|V|A|C|P|P|V|T
Original Position
12|21|19|15|21|0|2|15|15|21|19
Shifted Position
19|0|10|4|0|1|17|4|4|0|10
Original Message TAKE A BREEAK= "Take a breeak"
Exercise 3.2
Assignment
Watch the video clip and complete the statements that follow.