Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Matm Finals

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

CODING THEORY -is the study of the properties of 

codes and their respective fitness


for specific applications. Codes are used for data compression, cryptography, error
detection and correction, data transmission and data storage.

Codes -are studied by various scientific disciplines, such as information


theory, electrical engineering, mathematics, linguistics, and computer science—for the
purpose of designing efficient and reliable data transmission methods. This typically
involves the removal of redundancy and the correction or detection of errors in the
transmitted data.

There are four types of coding:


1. Data compression (or source coding)
2. Error control (or channel coding)
3. Cryptographic coding
4. Line coding

The communication system composed of sender (or message source),


communication channel, and the receiver

COMMUNICATION CHANNEL-Is the physical medium through which information is


transmitted.

Source Coding refers to data compression done at the receiver independently of


any error control coding, in order to reduce transmission time or signal bandwidth.

Two Processes in Coding


Encoding is transforming messaged into bits of message that is
suitable in communication.
 Decoding is the opposite process of encoding.

DATA COMPRESSION OR SOURCE ENCODING -is defined as converting the


message from the sender into bits suitable to the communication channel.

bit (short for "binary digit") is the smallest unit of measurement used to quantify
computer data. It contains a single binary value of 0 or 1

Byte refers to the number of bits used to represent a string of information.

Channel Coding -With this problem at hand, additional process of encoding is required.
Is defined as adding some form of redundancy to the source encoded message so that
the errors can be detected or even corrected

Parity Check -Parity check is also called as “Vertical Redundancy Check (VRC)”
Where in single bit is added to the message as redundancy bit.
A bit string is said to have an odd parity if there is an odd number of 1s.

There are two types of parity bits in error detection, they are

Even parity if there is an even number of 1s. We add redundancy bit to message such
that it will become an even parity.

Odd Parity -If the data has even number of 1’s, the parity bit is 0.

Odd number of 1’s, the parity bit is 1

Repetition Code: ENCODING -In coding theory, the repetition code is one of the most
basic error-correcting codes. In order to transmit a message over a noisy channel that
may corrupt the transmission in a few places, the idea of the repetition code is to just
repeat the message several times.

Repetition Code

 In coding theory, the repetition code is one of the most basic error-correcting
codes.
 In order to transmit a message over a noisy channel that may corrupt the
transmission in a few places, the idea of the repetition code is to just repeat
the message several times.
 Suppose that the source encoding is already done and that the encoded
message is of fix length k. The channel encoding by repetition is performed
by taking the k bits then repeating it 2r + 1, where r is greater than or equal
to 1 is a fixed integer.

Example

Suppose that the source encoded message is 101 where k=3. If you choose r=
2, the message must be repeated 2r +1 = 2(2) + 1 or 5 times. This will result to
101101101101101

MODULAR ARITHMETIC -Is a system of arithmetic for integers, which considers the
remainder

-Modular arithmetic, numbers "wrap around" upon reaching a given fixed quantity (this
given quantity is known as the modulus) to leave a remainder.

is a system of arithmetic for integers, which considers the remainder. In modular


arithmetic, numbers "wrap around" upon reaching a given fixed quantity (this given
quantity is known as the modulus) to leave a remainder.
CONGRUENCE
Let a and b are integers and n is a natural counting number. We say that a is
congruent to b modulo n in symbols :
a ≡ b(mod
n) If the difference of a and b is divisible
by n.
In addition, if n >0, and r is the remainder when b is divided by n, the
integer r is referred to as the least residue (0 ≤ 𝑟 ≤ 𝑛 − 1).
r ≡ b(mod n)
Least Residue is the remainder is either positive or zero.

CHECK CODES AND CHECK DIGITS -There are several methods in producing
identification numbers which are unique. In the following methods, modular arithmetic is
used to produce and verify identification numbers. The examples are; the Universal
Product Code (UPC), United States Postal Services (USPS), the Credit Card, and the
International Standard Book Number.

Universal Product Code (UPC) -is mainly used in products sold in department stores
and groceries. The UPC consists of barcodes with 12 digits where the last one is the
check digit.

CHECK DIGIT : d12


d12= 10 – (3d1 +d2 + 3d3 + d4 +3d5 +d6 + 3d7 + d8 + 3d9 + d10 + 3d11)
(mod10)

International Standard Book Number (ISBN) -is used on books where usually found
at the last page of the book. ISBN can be ISBN-10 or ISBN-13 where they used 10
digits or 13 digits string of number respectively with the last digit as the check digit.

CHECK DIGIT : d10


d10 = 11- (10d1 + 9d2 + 8d3 + 7d4 + 6d5 + 5d6 + 4d7 +3d8 +2d9 )(mod 11)

CHECK DIGIT : d13


d13= 10 – (d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 +3d8 + d9 + 3d10 + d11 +
3d12 )(mod10)

United States Postal Services (USPS) -is consist of 11 digits, while the Credit Card
uses 16 digits where both of them uses their last digits as the check digits.

CHECK DIGIT : d11


d11 = 9 – (d1 +d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 )(mod 9)

CHECK DIGIT : d16


d16 = 10 – (2d1 +d2 +2d3 +d4 +2d5 +d6 +2d7 +d8 +2d9 +d10 +2d11 +d12
+2d13 +d14+2d15 )(mod10)

*NOTE(For Credit Card): ADD ALL THE DIGITS, TREATING THE TWO-DIGIT
NUMBERS AS TWO SINGLE DIGITS.

CRYPTHOGRAPHY -It is a science of protecting information by encoding it into


unreadable format.

-Originated from two Greek words such as “KRYPTO” which means hidden and
“GRAPHENE” which means writing.

-It is a method of making and breaking of secret codes.

ENCRYPTION -is the process of transforming plain text into codes form using a certain
algorithm. It is the process of changing plain text to coded message.

DECRYPTION -is the process of returning/converting back the coded message into
plain text. It is the process of returning/converting back the coded message into plain
text.

PLAIN TEXT -refers to the original text

CIPHER TEXT - refers to the coded text

KEY - refers to the strings of information that is used to reveal the encryted message
into readable form.

SHIFT CIPHER (CEASAR CIPHER) -it is the simple type of substitution cipher.

 - it uses shift in forming the key of cryptography. It is the simplest type of


substitution cipher.
 It uses shift in forming the key cryptography.
 The cipher text is obtained from taking an equivalent of a single letter of the
alphabet to another letter by doing a uniform number of shifts either left or
right.
 Each letter of the alphabet should be matched exactly to one letter of
the cipher alphabet.

MODULO OPERATOR -the sender of the uses the key K to encrypt and to
decrypt the secret message.

 The key K may have any integer value from 0-25 and this will be shared to
the person/s who will be receiving the secret message.
 To encrypt the message:
1. Express the letters of the alphabet into an integer from 0 to 25, that matches its
order,
for example A = 0, B = 1, C = 3 ….., then label them as C
2. Calculate Y = (C+ K) mod 26 , for every letter of the message.
3. Convert the number Y into a letter following the order of the letter of the
alphabet.

 To decrypt the message:


1. Express the letters of the alphabet into an integer from 0 to 25, that matches its
order,
for example A = 0, B = 1, C = 3 ….., then label them as Y
2. Calculate C = (Y - K) mod 26 , for every letter of the decrypted message.
3. Convert the number C into a letter following the order of the letter of the
alphabet.

APPORTIONMENT -“ the equal proportion”

-Is a method of dividing a whole into various parts.

-It means that the numbers of representative (the seat) is proportion to the population
size being represented.

The Hamilton Plan

 Standard divisor (D) –the number of voters represented by each representative.


 Standard quota (Q) – the whole part of the quotient when the population of the
sub – group is divided by the standard divisor.

Note:

1. Standard quota , Q must be an integer. In case of decimals, just drop the


decimal values.
2. When the total standard quota is not equal to given total apportioned or the
number of representative , place an additional representative to the next the
sub – group representative with the highest decimal value until the
representatives are complete.

The Jefferson Plan -This method uses a modified standard divisor the arrives at the
correct or exact numbers of representative using trial and error. The modified uses an
assume value always smaller than the standard divisor

APPORTIONMENT PRINCIPLE METHOD - In this method the representative is


assigned to the group in such a way it gives the smallest relative unfairness of
apportionment.

Huntington – Hill apportioned method -The method that make use of equal
proportion. The new additional representative to a sub – group must have the highest
Huntington number.

VOTING -It is a method that uses votes to determine the winner.

Methods of voting

Majority Voting -over 50 % of the people voting must vote for the candidate

PLURALITY METHOD -Each voter votes for one candidates, and the candidate with
the most votes wins.

-In-case of ties, voting should be done using the run-off election.

BORDA COUNT METHOD -Award points to candidates based on preference schedule,


then declare the winner to be the candidate with the most points.

PLURALITY BY ELIMINATION -The plurality with elimination voting method is also


known as an instant run-off voting and sequential run-off voting.

-It is a preferential voting method and candidates that have the least first place votes get
eliminated until one candidate has majority of first place votes.

Pairwise comparison Voting -Compare each two candidates head-to-head.

-Award each candidate one point for each head-to-head victory.

-The candidate with the most points wins.

MAJORITY VOTING
Majority Vote: over 50 % of the people voting must vote for the candidate

PLURALITY METHOD
Voting Method in which the candidate with the most first-place vote is the
winner.

BORDA COUNT METHOD


Award points to candidates based on preference schedule, then declare the
winner to be the candidate with the most points.

BALLOT
POINTS
ST
B gets 3 points
1 B
ND
D gets 2 points

2 D A gets 1 point
PLURALITY BY ELIMINATION METHOD
The plurality with elimination voting method is also known as an instant run-
off voting and sequential run-off voting. It is a preferential voting method and
candidates that have the least first place votes get eliminated until one candidate
has majority of first place votes.
PAIRWISE COMPARISON VOTING METHOD
 Compare each two candidates head-to-head.
 Award each candidate one point for each head-to-head victory.
 The candidate with the most points wins.

You might also like