Professional Documents
Culture Documents
MATM-FINALS-REVIEWER
MATM-FINALS-REVIEWER
MATM-FINALS-REVIEWER
• Encoding
o transforming messaged into bits of
message that is suitable in
communication.
• Decoding
By P <<33
Assume that the message transmitted through a
noisy channel and distorted. The received
Channel Coding
message is 111001101110010. The channel
• defined as adding some form of redundancy to the encoding uses repetition code where k= 3.
source encoded message so that the errors can be Decode the received message.
detected or even corrected
Solution
Parity Check 111 001 101 110 010
First Bit - Consider the most frequent bit in
• Parity check is also called as “Vertical
positions 1,4,7,10, and 13
Redundancy Check (VRC)”
Second Bit – Consider the most frequent bit in
• Where in single bit is added to the message as
positions 2,5,8,11, and 14
redundancy bit.
Third Bit – Consider the most frequents bit in
• A bit string is said to have an odd parity if there
positions 3, 6, 9, 12, and 15
is an odd number of 1s.
• Even parity if there is an even number of 1s. We 111/001/101/110/010
add redundancy bit to message such that it will 1 2 3 / 4 5 6/ 7 8 9 / 10 11 12 / 13 14 15
become an even parity.
Two types of parity bits in error detection Decoded Message: 111
• To determine the least residue is to simply get the ii. (31 + 7) (mod 3)
remainder when b is divided by m. 38 (mod 3)
• b(mod m) means b divided by m. m is referred to r=2
as the modulus (divisor)
• Find the least residue, r iii. 12 – 5 (mod 3)
r = 54(mod 7) 12 – 2
r = 10
Three solutions: Choose what’s easier for you
a. iv. 15 – (11+12) (mod 13)
15 – 23 (mod 13)
15 – 10
r=5
Note: Mauuna lahat ng parenthesis. Kapag walang
parenthesis, subtract the second given number sa mod,
then continue.
CRPTOGRAPHY
r=5
• It is a science of protecting information by
b. Sa calculator: encoding it into unreadable format.
54 ÷ 7 = 7. 71 • Originated from two Greek words such as
(.71) (7) = 5 “KRYPTO” which means hidden and
r=5 “GRAPHENE” which means writing.
• It is a method of making and breaking of secret
c. Hahanapin ang pinaka malapit na number sa 54 codes.
na divisible by 7, then subtract. • a science of encrypting and decrypting written
54 – 49 = 5 communication
r=5
Encryption
More examples:
• the process of transforming plain text into codes
a. Determine the least residue of 89 (mod 9) form using a certain algorithm.
r=8
Decryption
b. Determine the least residue of 120 (mod 10)
r = 0 (no reminder/least residue) • the process of returning/converting back the
c. Determine the least residue of 18 (mod 20) coded message into plain text.
r = 18 (kasi mas mataas yung mod and when
you divide it, the answer will be decimal and
no whole number, so automatically, 18 will be
the reminder/least residue.)
OPERATIONS IN MODULAR ARITHMETIC
Note: Kapag to the left, just count the number given from
the last letter (Z) backwards. Kapag to the right, add 1 sa
given number (ex. Given number is 4, sa 5th letter ang start
ng A) or just simply start counting at the second letter (B) C = number of the certain letter
K = given
Modulo Operator
C - K = difference of C and K
• the sender of the uses the key K to encrypt and to Y = lower than 26; remain the number. Higher
decrypt the secret message. than 26; subtract the number to 26
• Encrypt Steps
CHECK CODES AND CHECK DIGIT
I. express the letters of the alphabet from 0
to 25 • There are several methods in producing
II. calculate Y = (C+K) mod 26 identification numbers which are unique.
III. convert the number Y into a letter • In the following methods, modular arithmetic is
following the order of the letter of the used to produce and verify identification
alphabet numbers.
A B C D E F G H I J K L M • The examples are;
0 1 2 3 4 5 6 7 8 9 10 11 12 o Universal Product Code (UPC)
N O P Q R S T U V W X Y Z
- mainly used in products sold in
13 14 15 16 17 18 19 20 21 22 23 24 25
department stores and groceries. The
UPC consists of barcodes with 12
Example: digits where the last one is the check
digit.
Encrypt the message. “MMW is fun to learn” let k = 5
By P <<33
International Standard Book Number (ISBN - 10)
Note:
By P <<33
B. The standard quota 𝐷 = 9.95
𝒏 B. The standard quota
# of 𝑸= Corrected
Grade students 𝑫 Q Q
Q (Try and error. Lower/smaller than the
40
original D)
Grade 12 40 4.02 4 4 Let’s start with 9.00 or 9 (instead of 9.95)
9.95
35
Grade 11 35 3.52 3 4 𝒏
9.95 𝑸=
22 Grade # of students 𝑫 Q Q
Grade 10 22 2.21 2 2
9.95
38 40
Grade 9 38 3.81 3 4 Grade 12 40 4.44 4
9.95 9
25 35
Grade 8 25 2.51 2 2 Grade 11 35 3.88 3
9.95 9
39 22
Grade 7 39 3.91 3 4 Grade 10 22 2.44 2
9.95 9
38
Total 199 17 20 Grade 9 38 4.22 4
9
25
Grade 8 25 2.77 2
9
Note: 39
Grade 7 39 4.33 4
9
• Yung pangalawang Q, yun yung tatanggalin mo Total 199 19
yung decimal (drop the decimal)
• Dahil 17 lang yung total nung Q, and 20 yung
supposed-to-be answer (based sa given sa Note:
sentence), need mag add • Since 19 yung total, which is kulang pa ng 1 para
• Kung ano yung malaki ang decimal, yun yung makuha ang sagot na 20, hindi tayo mag aadd.
dadagdagan. Disregard the whole number, look • Instead, we’ll try another D again. And since
ONLY sa decimal (Example: 3.51, and 2.72, mas we’re looking for higher Q, we need lower D.
mataas ang 72, kaysa sa 51, kahit mas mataas ang
3 sa 2) C. The standard quota
• Kung ilan ang need para mabuo yung supposed- (Second try and error. Let’s use 8.5 as our D
to-be answer, yun ang bilang ng hahanapin mong now)
mas mataas ang decimal, then add 1 sa Q (kung
𝒏
saan nadrop na yung decimal) 𝑸=
Grade # of students 𝑫 Q Q
THE JEFFERSON PLAN
40
Grade 12 40 4.71 4
• This method uses a modified standard divisor the 8.5
35
arrives at the correct or exact numbers of Grade 11 35 4.11 4
8.5
representative using trial and error Grade 10 22
22
2.59 2
• The modified uses an assume value always 8.5
38
smaller than the standard divisor. Grade 9 38 4.47 4
8.5
25
Example Grade 8 25 2.94 2
8.5
39
1. A new school offering the complete six grades in Grade 7 39 4.59 4
8.5
high school has the following enrollment in the Total 199 20
different grades below. The administration is to
apportioned the 20 teachers for each grade.
Note:
Calculate
• Until you get the answer, you won’t stop the
A. The standard divisor trying and error, no adding, unlike the Hamilton
𝑁 Plan.
𝐷= 𝑅
199
𝐷= 20
By P <<33
THE APPORTIONMENT PRINCIPLE HUNTINGTON – HILL APPORTIONED METHOD
• A new representative is added to a sub – group • The method that make use of equal proportion.
due to an increase in population. • The new additional representative to a sub
• The representative is assigned to the group in o group must have the highest Huntington
such a way it gives the smallest relative number.
unfairness of apportionment.
Example:
Example:
1. RBSN company wants to add a new call center
1. RBSN company wants to add a new call center agent in one of its office. Report indicate an
agent in one of its office. Report indicate an increase in the daily calls of the offices in the past
increase in the daily calls of the offices in the past month. Determine which office should get the
month. Determine which office should get the additional agent. Use the Huntington –Hill
additional agent. Use the apportionment principle apportionment to justify your answer.
to justify your answer.
Solution:
(𝑃 )2
𝐴
H = 𝑎(𝑎+1)
A. Makati
(𝑃 )2
𝐴 (882)2
H = 𝑎(𝑎+1) = 62 (62+1) = 199.16
B. Ortigas
(𝑃 )2
𝐴 (996)2
H = 𝑎(𝑎+1) = 48 (48+1) = 421.78
Answer:
Since H = 421.77 has the highest Huntington – Hill
• R = 0.30 (the lowest) means the new agent or number, so that the Ortigas office will get the new agent.
representative will goes to Ortigas office.
VOTING
Note:
• Voting is a powerful tool in decision making.
• We assumed that C1 is Makati and C2 is Ortigas. • It is a method that uses votes to determine the
Kaya sa Makati, nag add tayo ng 1 dun sa number winner.
of agents sa C1, then we added 1 number of
METHODS
agents sa Ortigas sa C2.
• The 1 represents the one whose receiving MAJORITY VOTING AND PLURAITY METHOD
(something, ewan kay ma’am, basta
representative that is on receiving.) Majority Voting
By P <<33
Plurality ➢ Each third-place vote is worth N –2points
➢ Each Nth-place (i.e., last place) vote is
• Each voter votes for one candidate, and the worth 1 point.
candidate with the most votes wins.
• In-case of ties, voting should be done using the Example:
run-off election
1. Who is the winner under the Borda Count?
Example
1. Which among the four candidates won
(a) By Majority (b) by Plurality
Candidate A:
(3 x 10) + (2 x 20) + (1 x 40) = 110 points
Candidate B:
(3 x 20) + (2 x 40) + (1 x 10) = 150 points
• Only look for the 1st choice
• A has 5 votes. B has 6+3 votes, C has 2 votes and Candidate C:
D has 4 votes. (3 x 40) + (2 x 10) + (1 x 20) = 160 points
(b) By Plurality
• B is the winner/answer, since B got the
highest number of votes which is 9.
BORDA COUNT METHOD
Bonifacio (B):
(4 x 35) + (2 x 30) + (2 x 20) + (1 x 15) = 255
points
• In general, if Nis the number of candidates...
➢ Each first-place vote is worth N points. Calixto (C):
➢ Each second-place vote is worth N – (3 x 35) + (1 x 30) + (4 x 20) + (3 x 15) = 260
1points. points
By P <<33
Dancel (D): Note:
(1 x 35) + (4 x 30) + (1 x 20) + (4 x 15) = 235 • Tatanggalin yung candidate sa 1st choice
points na may pinaka konting vote number, then
yung candidate na yon, aalisin siya sa
CALIXTO wins. lahat ng part (1st, 2nd, 3rd choice etc)
• Example: dito, yung candidate C ang
Note:
may pinaka konting number of votes sa
• First place, second place etc. is based on the 1st choice with 2 votes, so aalisin si C sa
given. IT IS GIVEN. lahat.
• Kung ilan yung given, yun ang bilang ng points,
basta yung pinaka last, lagging 1 point. If 10 yung Step 2: Adjust the ranking of the remaining
candidates, then 10 points yung sa first place. If 6 candidates
yung candidates, then 6 points yung sa first place.
PLURALITY BY ELIMINATION
Note:
• Tulad lang ng sa step 1, and step 2.
Tanggalin yung fewest vote (naging
fewest yung D, since it only has 4 votes,
while B has 6+3=9, and A has 5+2=7.
• Then move ulit UPWARDS.
By P <<33
Solution:
A = 5+2+4 = 11
B=6+3=9
Step 4: Compare B to C.
• 6+3 =9 voters prefer B.
• 5+ 2+ 4 = 11 voters prefer to C.
• C wins the pairwise comparison and gets
1 point.
Step 5: Compare B to D.
• 6+3 =9 voters prefer B.
Step 1: Compare A to B. • 5 + 2+ 4 = 11 voters prefer to D.
• 5+ 2+4 = 11 voters prefer A. • D wins the pairwise comparison and gets
• 6+ 3= 9 voters prefer to B. 1 point.
• A win the pairwise comparison and gets
1 point. Step 6: Compare C to D
• 6+2 =8 voters prefer C.
• 5 + 3+ 4 = 12 voters prefer to D.
• D wins the pairwise comparison and gets
1 point.
Note: