Prefinal Module

You might also like

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

UNIT 5 – THE BEAUTY OF CODES

People have always had a fascination with keeping information away from others. As children, many of us had
magic decoder rings for exchanging coded messages with our friends and possibly keeping secrets from parents,
siblings, or teachers. History is filled with examples where people tried to keep information secret from adversaries.
Kings and generals communicated with their troops using basic cryptographic methods to prevent the
enemy from learning sensitive military information.

Unit Intended Learning Outcomes (UILO)


Describe some coding schemes that are used to assign identification numbers.
• Use check digits for error detection.
• Detect ZIP code errors.
• Analyze encrypted data.

Module 15. CODING

A mysterious code underpins the world. But what does it mean and what can we learn from it?

A code that has the power to explain everything, from the numbers and shapes we see all around us to the
rules that govern our own lives. There are many beautiful images and animations created using computer code with a
mathematical basis. Some of them are quite simple to produce and could make good class exercises (or mini projects)
at the intersection of mathematics, coding and art.

This is also an additional video about coding: Welcome to the Code - The Code
https://www.youtube.com/watch?v=5RAtFSEkFho&feature=youtu.be&list=PLDEBDDFFEF0CE049A

Intended Learning Outcomes


At the end of module 15, students are expected to:
1. detect the check digit is accepted or not.
2. solve for the unknown check digit of the barcode.
3. decode the code of the given barcode.

Values Integration
Any researcher who wishes to become proficient at doing qualitative analysis must learn to code well and
easily. The excellence of the research rests in large part on the excellence of the coding. (Anselm L. Strauss,
Qualitative Analysis for Social Scientists, 1987, p. 27)

INPUTS
CODING

A code in qualitative inquiry is most often a word or short phrase that symbolically assigns a summative,
salient, essence-capturing, and/or evocative attribute for a portion of language-based or visual data. The data can
consist of interview transcripts, participant observation field notes, journals, documents, literature, artifacts,
photographs, video, websites, e-mail correspondence, and so on.

Code were already around since ancient times. A code is a symbolic way to represent information. In
qualitative inquiry, a code is most often a word or short phrase that symbolically assigns a summative, salient, essence-
capturing, and/ or evocative attribute for a portion of language-based or visual data (Saldaña, 2013). Below is an
example of a coded data in a qualitative data analysis (Saldaña, 2013 pp. 3–4).

1
CODE
I notice that the grand majority of homes have chain link fences in front of them. There are many Security
dogs (mostly German shepherds) with signs on fences that say, “Beware of the Dog.”

Emergency rescue workers or police officers may say, "There is a 'K'" Dead body

Readers may use other words and phrases to code the above-mentioned data since in qualitative data
analysis, coding is not a precise science.

During the ancient times, codes were already used by humans. Hieroglyphics or “sacred writings” were
codes used by ancient Egyptians in their writing system. Roman numerals were developed to easily determine the
prices of commodities and services rendered by the Romans. Roman numerals were used throughout Europe up until
the 1600s.
Hieroglyphics Roman Numerals

Another oldest number system came from ancient


Egypt, with the earliest record of being recovered from
3000 BC, over 5000 years ago. The Egyptian counting
system was very comprehensive compared to others.
They even had a symbol to represent infinity (“Ancient
Rome: The Epic Guide,” 2017).

Ancient Egyptian Hieroglyphic numeral


system

The label sewn onto a t-shirt has information


on the fabric composition and country where the item
was manufactured. The code is like an Attribute
Code for the clothing item’s content.
2
The more recently invented codes are musical scores, genetic codes, and the DNA or deoxyribonucleic acid.

Identification numbers are used to identify individual items, specific products, people, accounts or
documents. These numbers are useful for easy recognition and detection of materials and for tracking and inventory of
products or documents (Kirtland, 2001).

A numeric identification number is a single positive number or


ID number
a string of digits, sometimes separated by spaces or dashes.
Bar codes
An alphanumeric identification number has a string of digits,
Credit Card
letters, and/ or other symbols. The following are examples of
Phone Numbe
identification numbers:
Zip Codes
NUMERIC
IDENTIFICATION
NUMBER

A check digit or a check sum is used to verify errors on identification numbers. A check digit is a single
number that is generated using the other characters from the different check digit schemes.

For the Universal Product Code (UPC), the check digit is usually indicated on the far right of the UPC. UPC is
the barcode which is the identification number of a retail item such as a grocery product. It consists of twelve digits, the
first eleven (11) characters specify the source of the item and the product number. The twelfth digit is the check digit
typically a modulo 10 check digits.

3
Consider a 12-digit UPC: A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12. The following computation is carried out in which each
digit in an odd-numbered position is multiplied by 3, then all the numbers are added such that: 3A1 + A2 + 3A3 + A4 + 3A5
+ A6 + 3A7 + A8 + 3A9 + A10 + 3 A11 + A12

If this sum does not end with 0, the entered barcode number is incorrect. To illustrate how a UPC check digit is
calculated, consider the following examples:
Examples:
1. Consider the UPC 77083230854 and find its check digit.
Solution:

2. Consider the number found at the bottom of a Corn Flakes box as follows: 0 3 8 0 0 0 0 0 1 2 7 7
Solution:

3. Suppose that the packaging of a grocery item was damaged in such a way that the fifth digit of a 12-digit UPC
was scratched off, but the remaining 11 digits show
8 8 0 7 _ 2 3 0 3 5 8 4. Determine the correct UPC.
Solution:

Consider a 13-digit UPC: A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13. The following computation is carried out in which
each digit in an even-numbered position is multiplied by 3, then all the numbers are added such that: A1 + 3A2 + A3 + 3A4
+ A5 + 3A6 + A7 + 3A8 + A9 + 3A10 + A11 + 3A12 + A13

If this sum does not end with 0, the entered barcode number is incorrect. To illustrate how a UPC check digit is
calculated, consider the following examples:

1. Consider the UPC 978-971-98-1072-_ and find its check digit.


Solution:

2. Check if the barcode 4806523080026 have an error or not?


Solution:

A barcode is a set of vertical bars (long and short) and spaces which provide an indispensable tool for tracking
a variety of data from pricing to inventory. Cashiers in most establishment make use of automated cash registers.
Decoding information in a barcode is done through the use of a handy scanner which has the capability of converting a
code into specific data.
Barcoding is an efficient way of translating data instantaneously and accurately. It is used f or automated data
collection. It eliminates the occurrence of human error since through the use of a bar scanner, transmitting data is faster
and more reliable and takes lesser time than entering them manually. Barcodes were first used on June 26, 1974 with
10-pack Wrigley’s Juicy Fruit gum.
According to Stewart (1995), the simplest barcode is the Postnet Code X by the US Portal Service which is
commonly seen in business reply envelopes.

The ZIP+4 code which is the ZIP code of the


US
Portal Service which started in 1983, contains 52
long and
short vertical bars (Stewart, p. 584). The long bars at
the
beginning and end of the ZIP+4 code serve as guard
bars of
the remaining 50 bars are divided into blocks of 5 and
each
block contains two long bars and three short bars.
Each block
represents a single digit and the 10th digit is used for error
correction. Below is the pattern used for the bar codes
(Stewart, p. 584). https://barcode.tec-it.com/en/PostNet9
If the ZIP+4 code is denoted by A 1 A2 A3 A4 A5 A6 A7 A8 A9 A, the check digit A has the property that the sum of
A1 + A2 + A3 + A4 + A5 + A6 + A7 +A8 + A9 +A ends with 0, the sum of the digits is divisible by 10. An error is easily
detected in a ZIP+4 code if block of vertical bars does not contain exactly 2 long bars and 3 short bars. And because
the location of the wrong block can be detected, the check digit is used to correct such an error.

Examples: Identify the Digit of the Barcode given.

1.
Solution:

2.
Solution:

3.
Solution:

ACTIVITY
WHAT’S THE PASSWORD?
Given the barcode, decode it to get the password.

1.

2.

ASSESSMENT

A. Identify the unknown number to complete the code.


1. Given the barcode of a notebook 480250152002__, solve for the check digit to complete the code? 2.
Given the barcode of a notebook 978971234994__, solve for the check digit to complete the code? B. Decode
the ZIP+4 code.

1.

2.

UNIT 6 – APPORTIONMENT

Apportionment is a method of dividing a whole into various parts. This mathematical analysis has its roots in
the U.S. constitution. It started in1790 when the House of Representatives attempted to apportion itself. The issue then
was to find how many voters would be represented by each member of the House. The first method introduced in1790
to solve this problem was suggested by Thomas Jefferson and came to be known as the Jefferson Plan. Another
method was also proposed by Alexander Hamilton, the Hamilton Plan, which was only adopted later at about 1850.

Unit Intended Learning Outcomes (UILO)


Apply apportionment to solve problems.
• Solve the number of representatives using the two ways of apportionment.
• Divide the number of representatives correctly with their corresponding data.
• Differentiate the methods of apportionment on how they produced their results.

Module 17. THE HAMILTON PLAN

Hamilton’s method can be described as every state gets at least its lower quota. As many states as possible
get their upper quota, with the one with highest residue having first priority, the one with second highest residue second
priority, and so on.

Hamilton’s method is still used today to apportion the legislatures of Costa Rica, Namibia, and Sweden.
Hamilton’s method creates a systematic bias in favor of larger states over smaller ones.

Intended Learning Outcomes


At the end of module 17, students are expected to:
1. Solve for the standard divisor.
2. Solve for the number of representatives to be apportioned to the corresponding data.
3. Apply Hamilton method of apportionment to solve problems.

Values Integration
“The essence of mathematics is not to make simple things complicated, but to make complicated things
simple.” —S. Gudder

INPUTS
THE HAMILTON PLAN

To illustrate how the Hamilton plan works, consider a fictitious country named Andromeda with a population of
33,000 and having twelve states. The population of each state is given by the table below.
STATE POPULATION

Andersen 3,250

Ballard 2,750

Bednar 3,000

Christofferson 2,500

Cook 3,500

Draco 3,000

Hales 2,500

Holland 2,250

6
Libra 4,000

Nielsen 3,750

Nelson 1000

Oaks 1,500

Suppose that Andromeda’s constitution calls for 70 representatives to be chosen for these twelve states. The
number of representatives is to be apportioned according to the population of each state.
To determine the number of representatives of each Standard Divisor = ����������
state under the Hamilton method, divide first the total population ������������������
(33,000) by the number of representatives (70). This number is ��
called the standard divisor. ������������
���� ������������
STANDARD DIVISOR �����������������
�����

����,������
The Andromeda, the standard divisor is Standard Divisor =

����≈

471.43.

Now divide the population of each state by the standard divisor Solution:
and round the quotient down to a whole number. For example,
STANDARD QUOTA
7.4 and 7.6 should be rounded down to 7. Each whole number
Standard quota is the whole number part of the quotient of a
part of a quotient is called the standard quota.
population divided by the standard divisor.

STATE POPULATION QUOTIENT STANDARD QUOTA

Andersen 3,250 3,250 6


471.43= 6.89

Ballard 2,750

Bednar 3,000

Christofferson 2,500

Cook 3,500

Draco 3,000

Hales 2,500

Holland 2,250

Libra 4,000

Nielsen 3,750

Nelson 1000

Oaks 1,500

After solving for the standard quota, get the total of standard quota. The standard sub -quotas totaled to ___.
______ representatives short as required by the Andromeda Constitution. When this happens, the Hamilton plan
remediates by assigning one representative to the state with the largest decimal remainder. This method continues until
the required number of representatives is attained.

7
Solution:
STATE POPULATION QUOTIENT STANDARD ADDITIONAL NUMBER OF
QUOTA REPRESENTATIVE REPRESENTATIVES

Andersen 3,250 3,250 6


471.43=
6.89
Ballard 2,750

Bednar 3,000

Christofferson 2,500

Cook 3,500

Draco 3,000

Hales 2,500

Holland 2,250

Libra 4,000

Nielsen 3,750

Nelson 1000

Oaks 1,500

Example: Find the correct apportion of the given problem using Hamilton Plan.
1. A total of 25 teacher aides are to be apportioned among seven classes shown in the following table:
CLASS NUMBER OF STUDENTS

Kindergarten 38

First Grade 39

Second Grade 35

Third Grade 27

Fourth Grade 21

Fifth Grade 31

Sixth Grade 33

TOTAL

Solution:
8
ACTIVITY
Solve the following problem using Hamilton Plan. Show your solution.
A. The following table shows the enrollment for each of the four divisions of the college. The four divisions are
science, business, education and engineering. There are 180 new computers that are to be apportioned
among the divisions based on the enrollments.
DIVISION ENROLLMENT

Science 3455

Business 4678

Education 5780

Engineering 1896

TOTAL 15809

1. What is the standard divisor for an apportionment of the computers?


2. Use Hamilton method to determine the number of computers to be apportioned to each division.

B. A hospital district consists of six hospitals. The district administrators have decided that 48 new nurses
should be apportioned based on the number of beds in each of the hospitals. The following table shows
the number of beds in each hospital.
HOSPITAL NUMBER OF BEDS

Gumercindo 242

HMOMH 356

District 308

Queen of Mercy 190

BAMC 275

Riverside 410

TOTAL 1781

1. Determine the standard divisor.


2. Use Hamilton method to determine the number of nurses to be apportioned to each hospital.
9

Module 18. THE JEFFERSON PLAN

As we saw with the Hamilton plan, dividing by the standard divisor and then rounding down does not always
yield the correct number of representatives. In the previous example, we were three representatives short. The
Jefferson plan attempts to overcome this difficulty by using a modified standard divisor.

Intended Learning Outcomes


At the end of module 18, students are expected to:
1. Solve for the standard divisor.
2. Solve for the number of representatives to be apportioned to the corresponding data.
3. Apply Jefferson method of apportionment to solve problems.
4. Differentiate the results produced by Jefferson method to Hamilton method.

Values Integration
“Nothing gives one person so much advantage over another as to remain always cool and unruffled under all
circumstances.” ― Thomas Jefferson

INPUTS
THE JEFFERSON PLAN

Under the Jefferson Plan, the standard quota is computed in the same way of way as the Hamilton Plan. But if
the total of the standard sub-quotas does not yield the correct number of representatives, a modified standard divisor is
employed. This number is chosen by trial and error. The modified standard divisor is less than the standard divisor
(using the Hamilton Plan). This is to get a larger quotient and eventually get a larger sum for the standard sub-quotas.

Suppose we let the modified standard divisor (MSD) be equal to 450. The table shows the results when the
modified standard divisor is 450.
STATE POPULATION QUOTIENT (MSD=450) NUMBER OF REPRESENTATIVES

Andersen 3,250 3,250 7


450= 7.22

Ballard 2,750

Bednar 3,000

Christofferson 2,500

Cook 3,500

Draco 3,000

Hales 2,500

Holland 2,250

Libra 4,000

Nielsen 3,750

Nelson 1000

Oaks 1,500

TOTAL
Observe that the total number of representatives is ___ short of the required number which is 70. Hence, 450
is not a correct MSD. In this case the MSD needed should be smaller than 450.

10
Solution:
STATE POPULATION QUOTIENT NUMBER OF REPRESENTATIVES
MSD=

Andersen 3,250 3,250 7


450= 7.22

Ballard 2,750

Bednar 3,000

Christofferson 2,500

Cook 3,500

Draco 3,000

Hales 2,500

Holland 2,250

Libra 4,000

Nielsen 3,750

Nelson 1000

Oaks 1,500

TOTAL

Example: Find the correct apportion of the given problem using Jefferson Plan.
2. A total of 25 teacher aides are to be apportioned among seven classes shown in the following table:
CLASS NUMBER OF STUDENTS

Kindergarten 38

First Grade 39

Second Grade 35

Third Grade 27

Fourth Grade 21

Fifth Grade 31

Sixth Grade 33

TOTAL
Solution:

11
ACTIVITY
Solve the following problem using Hamilton Plan. Show your solution.
A. The following table shows the enrollment for each of the four divisions of the college. The four divisions are
science, business, education and engineering. There are 180 new computers that are to be apportioned
among the divisions based on the enrollments.
DIVISION ENROLLMENT

Science 3455

Business 4678

Education 5780

Engineering 1896

TOTAL 15809

1. What is the standard divisor for an apportionment of the computers?


2. Use Jefferson method to determine the number of computers to be apportioned to each division. 3. How
do the apportionment results produced using the Jefferson method compare with the results produced
using Hamilton method?

B. A hospital district consists of six hospitals. The district administrators have decided that 48 new nurses
should be apportioned based on the number of beds in each f the hospitals. The following table shows
the number of beds in each hospital.
HOSPITAL NUMBER OF BEDS

Gumercindo 242

HMOMH 356

District 308

Queen of Mercy 190

BAMC 275

Riverside 410

TOTAL 1781

1. Determine the standard divisor.


2. Use Jefferson method to determine the number of nurses to be apportioned to each hospital. 3. How do
the apportionment results produced using the Jefferson method compare with the results produced using
Hamilton method?

ASSESSMENT

A college is divided into four department. The president decided to apportionment the 27 new digital projectors
to the four departments labeled A, B, C, and D. the following table shows the number of students enrolled to a
department.
DEPARTMENT NUMBER OF STUDENTS

A 840

B 1936

C 310

D 2744

TOTAL

1. Determine the standard divisor.


2. Use Hamilton method to determine the number of projectors to be apportioned to each department. 3. Use
Jefferson method to determine the number of projectors to be apportioned to each department. 4. How do the
apportionment results produced using the Jefferson method compare with the results produced using Hamilton
method?

12

You might also like