Matm - Finals
Matm - Finals
1|Nell Laminero
MATHEMATICS IN THE MODERN WORLD
With this problem at hand, additional process of REPITITION CODE: ENCODING
encoding is required known as Channel Coding . - 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.
CHANNEL CODING - Is defined as adding
- Suppose that the source encoding is already
some form of redundancy to the source encoded
done and that the encoded message is of fix
message so that the errors can be detected or even
length k. The channel encoding by repetition is
corrected.
performed by taking the k bits then repeating it
PARITY CHECK - Parity check is also called 2r + 1, where r is greater than or equal to 1 is
as “Vertical Redundancy Check (VRC)” a fixed integer.
- Where in single bit is added to the message as Example:
redundancy bit. Suppose that the source encoded message is
- A bit string is said to have an odd parity if 110 where k=3. If you choose r= 2 , the message
there is an odd number of 1s. must be repeated 2r +1 = 2(2) + 1 or 5 times.
- Even parity if there is an even number of 1s. This will result to 110110110110110
We add redundancy bit to message such that it REPITITION CODE: DECODING
will become an even parity Example:
Assume that the message transmitted through
a noisy channel and distorted. The received
message is 111001101110010 .The channel
encoding uses repetition code where k= 3.
Decode the received message.
Solution: 111 001 101 110 010
FIRST BIT- Consider the most frequent bit in positions
1,4,7,10, and 13
SECOND BIT- Consider the most frequent bit in
*There is two types of parity bits in error detection, positions 2,5,8,11,and 14
they are: THIRD BIT- Consider the most frequents bit in positions
ODD PARITY - If the data has even number of 3, 6, 9, 12, and 15
1’s, the parity bit is 0.
111/001/101/110/010
- Odd number of 1’s, the parity bit is 1.
1 2 3 / 4 5 6/7 8 9 /10 11 12 /13 14 15
Example:
Decoded Message : 111
Data is 10010001 -> parity bit 1
EVEN PARITY - If the data has odd number of
MODULAR ARITHMETIC
1’s, the parity bit is 0.
- Is a system of arithmetic for integers, which
- Even number of 1’s, the parity bit is 1. considers the remainder.
Example: - In modular arithmetic, numbers "wrap around"
upon reaching a given fixed quantity (this given
data is 10010101 -> parity bit 1
2|Nell Laminero
MATHEMATICS IN THE MODERN WORLD
quantity is known as the modulus) to leave a
remainder.
OPERATIONS IN MODULAR
ARITHMETIC
Modulo addition is defined as (a+b)mod m
Modulo subtraction is defined as (a-b)mod m
Modulo multiplication is defined as (a*b) mod m
Modulo division is defined as (a/b) mod m
Example:
1. 10 - 4 (mod 5) = 1
2. 11 + 7 (mod 3) = 0
3. 8 + 7 (mod 7) = 1
4. 20 - 7 (mod 5) = 3
5. 31 - 6 (mod 4) = 1
3|Nell Laminero
MATHEMATICS IN THE MODERN WORLD
Example:
1. Determine the check digit for a new product if
the first 11 digits are 8-21345- 67132.
SOLUTION: Let d1 =8, d2 =2, d3 =1, d4 = 3, d5
=4, d6 = 5, d7 = 6, d8 =7, d9 = 1, d10 =3, d11 = 2
d12= 10 – (3d1 +d2 + 3d3 + d4 +3d5 +d6 + 3d7
+ d8 + 3d9 + d10 + 3d11)(mod10
2. Determine the check digit for USPS if the first
10 digits are 12-2133-1321.
SOLUTION: Let d1 =1, d2 =2, d3 =2, d4 = 1, d5
=3, d6 = 3, d7 = 1, d8 =3, d9 = 2, d10 =1 d11 = 9
– (d1 +d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 +
d10) (mod 9)
3. Verify if the given Credit Card identification
number 4301-1234-8888-3751 is valid.
SOLUTION: Let d1 = 4, d2 = 3, d3 = 0, d4 = 1,
d5 = 1, d6 = 2, d7 = 3, d8 = 4, d9 = 8, d10 = 8,
d11 = 8, d12 = 8, d13 = 3, d14 = 7,and d15 = 5.
d16 = 10 – (2d1 +d2 +2d3 +d4 +2d5 +d6 +2d7
+d8 +2d9 +d10 +2d11 +d12 +2d13 +d14 +2d15
)(mod10)
5|Nell Laminero
MATHEMATICS IN THE MODERN WORLD
Simple Method
SHIFT CIPHER (CEASAR CIPHER)
- it is the simple type of substitution cipher
- it uses shift in forming the key of cryptography
CRYPTOGRAPHY
- 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
- coded text 12 12 22 8 18 5 20 13 19 14 11 4 0 17 13
KEY Add 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- the strings of information that is used to reveal
Ans 17 17 27 13 23 10 25 18 24 19 16 9 5 22 18
the encrypted message into readable form
6|Nell Laminero
MATHEMATICS IN THE MODERN WORLD
Y = (17 17 27 13 23 10 25 18 24 19 16 9 5 22 18)mod26
Y = (17 17 1 13 23 10 25 18 24 19 16 9 5 22 18)
Ans: R R B N X K Z S Y T Q J F W S
Steps to Decrypt:
1. Express the letters of the alphabet from 0-25
2. Calculate C=(Y-K) mod 26
3. Convert the number C into a letter following the
order of the letter of the alphabet
Example:
“RRBNXKZSYTQJFWS” let k = 5
A B C D E F G H I J K L M
0 1 2 3 4 5 6 7 8 9 10 11 12
N O P Q R S T U V W X Y Z
13 14 15 16 17 18 19 20 21 22 23 24 25
Y = (12 12 -4 8 18 5 20 13 19 14 11 4 0 17 13)mod26
Y = (12 12 22 8 18 5 20 13 19 14 11 4 0 17 13)
ANS: MMW IS FUN TO LEARN
7|Nell Laminero
MATHEMATICS IN THE MODERN WORLD
representative with the highest
decimal value until the
representatives are complete.
Example:
A new school offering the complete six
grades in high school has the following
enrolment in the different grades below.
The administrations are to apportion
the 20 teachers for each grade.
Calculate
a. The standard divisor
b. The standard quota
Solution:
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.
Methods of Apportionment
HAMILTON PLAN Completed Table:
Standard divisor (D) –the number of
voters represented by each
representative.
Formula:
D= Total Population =N
No. of representative R
Standard quota (Q) – the whole part of
the quotient when the population of the
sub – group is divided by the standard
divisor.
Formula:
Q= Sub-group population = n JEFFERSON PLAN
Standard Divisor D - This method uses a modified standard divisor
NOTE: that arrives at the correct or exact numbers
1. Standard quota , Q must be an of representative using trial and error.
integer. In case of decimals, just - The modified uses an assume value always
drop the decimal values . smaller than the standard divisor
2. When the total standard quota is
APPORTIONMENT
not equal to given total apportioned
or the number of representative ,
PRINCIPLE
place an additional representative - A new representative is added to a sub – group
to the next the sub – group due to an increase in population.
8|Nell Laminero
MATHEMATICS IN THE MODERN WORLD
- The representative is assigned to the group in additional agent. Use the Huntington –Hill
such a way it gives the smallest relative apportionment to justify your answer.
unfairness of apportionment.
Solution:
𝟐
𝑨 𝑷
Solution: Formula, H=𝒂(𝒂+𝟏)
Example:
RBSN company wants to add a new call centre agent
in one of its office. Report indicates an increase in the
daily calls of the offices in the past month. Determine
which office should get the additional agent. Use the
apportionment principle to justify your answer.
Answer:
R = 0.30 (the lowest ) means the new agent or
representative will goes to Ortigas office.
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.
Example:
RBSN company wants to add a new call center
agent in one of its office. Report indicate an
increase in the daily calls of the offices in the past
month. Determine which office should get the
9|Nell Laminero
MATHEMATICS IN THE MODERN WORLD
BORDA COUNT
- Award points to candidates based on
preference schedule, then declare the winner to
be the candidate with the most points.
BALLOT
ST POINTS
1 B B gets 3 points
ND
2 D D gets 2 points
VOTING 3
RD
A
A gets 1 point
10 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
- It is a preferential voting method and
candidates that have the least first place votes Step 3: Eliminate again candidate with the
get eliminated until one candidate has majority
of first place votes.
fewest 1st Place
Example:
A = 5+2+4 = 11
B = 6 + 3 =9
The winner is candidate A
PAIRWISE COMPARISON VOTING
- Compare each two candidate’s head-tohead.
- Award each candidate one point for each head-
to-head victory.
Step 1: Eliminate candidate with the fewest - The candidate with the most points wins.
1st Place Example:
Compare A to B.
5+ 2+4 =11 voters prefer A.
6+ 3= 9 voters prefer to B.
11 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
A wins the pairwise comparison and
gets 1 point.
Compare A to C.
5+3 =8 voters prefer A.
6 + 2+ 4 = 12 voters prefer to C.
C wins the pairwise comparison and
gets 1 point.
Compare A to D.
5+ 2 =7 voters prefer A.
6+ 3+4= 13 voters prefer to D.
D wins the pairwise comparison and
gets 1 point.
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.
Compare B to D.
6+3 =9 voters prefer B.
5 + 2+ 4 = 11 voters prefer to D.
D wins the pairwise comparison and
gets 1 point.
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.
A = 1, B = 0, C= 2, D = 3
Winner is D = 3
12 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
PATH
- A path in graph theory is a sequence of edges.
GRAPH THEORY Example:
GRAPH Consider the following graphs below.
- A diagram that contains information and
depicts connection and relationship between the
various parts of the diagram.
Example:
1.) Road Map
2.) Circuit Diagram
3.) Flow Chart
4.) Transportation Route
5.) Tree Diagram Paths Length
Essentials Features of a Graph Ade 3
Adc 3
THE OBJECTS – referred to as the nodes or
vertices Bce 3
Abced 5
EDGES – the connecting lines
adecb 5
Example: Consider the following graphs. Note:
1. A path can repeat edges.
1. The graph has 4 vertices and 4 edges 2. The length of a path refers to the number of edges
connected.
3. If the direction is not indicated in the graph by an
arrow, the movement is can be in any direction to find a
path (you can move backward and forward). However if
2. The graph has 4 vertices and 3 edges there is an arrow indicating direction the movement in
finding a path is in accordance with the indicated arrow
13 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
Paths Length Path Vertex
e4 e3 2 Sequence
e3 e2 e4 3 Acef LMNOP Not closed
e1 e5 e4 3 Acb LMNL Closed
e1 e5 e4 e3 e2 5 Fed PONO Not closed
e1 e5 e5 e4 4 ecabd ONMLNO Closed
VERTEX SEQUENCE OF A CYCLE
PATH - a path is called a cycle if the following
- a path is written in terms of edges. A path conditions are satisfied:
determines a sequence of vertices. a.) the path is closed,
b.) the path repeat no edges,
c.) the vertices of the vertex sequence of the
path are all distinct except for the 1st and last
vertices which are the same vertices.
Example:
Connected
14 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
COMPLETE GRAPH ACYCLIC GRAPH
- is a connected graph where every pair of - A graph is called acyclic graph if it has no
vertices is joined by an edge. cycle
Example: Example:
No Cycle, Acyclic
SIMPLE GRAPH
- a graph is simple if it has neither loop nor
parallel edges Cycle, CDHG- wsrv. Not Acyclic
Example:
Simple Graph
WEIGHTED GRAPH
- A graph whose edges are assigned with
weights. Weight may represent mileage, time,
cost, or some other quantities.
DEGREE OF A VERTEX Example: Consider the transportation route of
- The degree of a vertex is defined as the
a salesman;
number of edges connected to the vertex.
- If a graph contains a loop, the loop contributes
2 to the degree of the vertex
Example:
15 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
Example: Example:
Acyclic, Connected tree
16 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
Not connected, Does not contain Euler path and - Also known as Hamiltonian Circuit.
Euler circuit. - Named after Sir William Rowan Hamilton
(1805-1865) He marketed a puzzle in the mid
1800 in the form of a dodecahedron that
contains the name of a city in each corner. The
Connected, contains Euler path, All vertices has an problem is to visit each city exactly once by
even degree, Contains Euler Circuit. travelling along the edges and be able to return
to the starting city. (D.S. Malik and M.K. Sen)
FLEURY’S ALGORITHM
- Is used to find an Euler Circuit in a graph if the
graph has one.
STEPS:
1. Select any of the vertices in the graph as the Example:
starting point. The graph has Hamilton circuit: V1V2V3V4V5
2. Select any edge connected to the vertex
selected in step 1. Remove the edge. (The
removal of the edge must not disconnect the
starting vertex or the starting point). After the
removal of the edge a new vertex is reach. The graph has no Hamilton circuit, since it will
3. Select an edge connected to the new vertex make use of the middle vertex (V) twice.
and repeat step 2.
4. Repeat step 3 until the starting vertex is
reach.
Example:
DIRAC’S THEOREM
- Consider a connected graph with at least 3
vertices and no multiple edges. Let n be the
Let Vertex X be the starting point. number of vertices in the graph. If every vertex
- remove edge f has degree of at least n/2, then the graph must
- remove edge e be HAMILTONIAN.
- remove edge c Example:
- remove edge b
- remove edge a
therefore, the Euler Circuit is – fdecba (with a
vertex sequence: XYZZWYX)
HAMILTON CIRCUIT
- A closed path which uses each vertex of the
graph exactly once, except for the last vertex
which duplicate the 1st vertex.
17 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
Algorithm used to find a The Edge-Picking Algorithm
Hamiltonian Circuit Steps:
1. Mark the edge of the smallest weight in the graph.(if
GREEDY ALGORITHM two or more edges have the same weight, pick only
- Also known as shortest path algorithm one)
STEPS: 2. Mark the edge of next smallest weight in the graph,
1. Choose a vertex to start at, then travel as long as it does not complete a circuit does not add a
along the connected edge that has the smallest third marked edge to a single vertex.
weight.( if two or more vertices have the same 3. Continue this process until you can no longer mark
weight, pick any one) any edges. Then mark the final edge that completes the
2. After arriving at the next vertex, travel Hamiltonian circuit.
along the edge of smallest weight that connects PLANAR GRAPH
to a vertex not yet visited. Continue this
- is a graph that can be drawn so that no edge
process until you have visited all vertices.
intersects each other (except at vertices)
3. Return to the starting vertex
Example:
Example:
18 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
W X Y Z
W 0 2 1 1
X 2 0 0 0
Y 1 0 0 1
Z 1 0 1 2
Note:
1.) The entries indicate the edges between the
vertices. M(W,X) = 2 means that there are 2
edges that connects W & X. M(X,Y) = 0 means - M2 (W,W)= 3, means there 3 paths of length 2
that there is no edge that connects X & Y. that connects vertex W to itself. That is; e1e1,
2.The diagonal indicates the loop/s in the e6e6, e4e4.
graphs. M(Z,Z) =2 means that there is a loop - M2 (X,Z)=2 means there are 2 paths of length
that is connected to vertex Z 2 that connects vertex x to vertex Z, that is;
3.)The degree of the vertex is equal to the sum e1e4 and e2e3.
of the entries in its row or column.
4.) The matrix is symmetric with respect to its - Since the Matrix is symmetric, we can consider
diagonal. the upper diagonal or the lower diagonal.
Therefore the total number of paths of length
Deg(W) = 4 (sum of its column entry or of its is 3+3+3+3+2+2+2+2+2+2 =24 paths.
row entries) Note: Paths of length 3 is M3 of length 4 is M4 .
ADJACENCY MATRIX OF
SIMPLE GRAPH LESSON 2
Theorem: If M is the adjacency of a Application of Graph
simple graph, then the row* column entry of Mn
is equal to the number of length n from vertex THEORY OF THE PIPELINE
from row to the vertex in column, n=1,2,3… PROBLEM
Example: Consider the Graph - The MAYNILAD is considering 8 cities to be
connected by a pipeline. The distances (in km)
between cities are given in the graph below:
19 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
Total weight of the minimal spanning tree = 80 - Use 4 colors to be assigned to its vertices.
+ 90+ 80+150 +60+70+105 = 635 - Assigned 2 different colors to any 2 adjacent
vertices.
Therefore, Maynilad needs 635km length of
pipeline to connect the 8 cities.
20 | N e l l L a m i n e r o
MATHEMATICS IN THE MODERN WORLD
V1V2V3V4V5V14V13V12V11V10V9V8V7V17V18V19V
20V16V15V6V1.
21 | N e l l L a m i n e r o