0% found this document useful (0 votes)
4 views120 pages

02 Quantitative - Reasoning

master in statistics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views120 pages

02 Quantitative - Reasoning

master in statistics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 120

Math-408 [3(3-0)]

Quantitative Reasoning-
I
Muhammad Arslan Bhatti

M. Arslan Bhatti, Department of Math & Stat 1


Number system and basic
arithmetic operations

M. Arslan Bhatti, Department of Math & Stat 2


Number Systems
After completing this chapter, you will be able to:

• Define the decimal, binary, octal, and hexadecimal


numbering systems and be able to convert from one
numbering or coding system to another
• Define the terms bit, byte, word, least significant bit
(LSB), and most significant bit (MSB) as they apply to
binary memory locations
• Add, subtract, multiply, and divide binary number

M. Arslan Bhatti, Department of Math & Stat 3


.1 Decimal System
Knowledge of different number systems and digital codes is quite
useful when working with almost any type of digital computer. This is
true because a basic requirement of these devices is to represent,
store, and operate on numbers. In general, computer work on binary
numbers in one form or another; these are used to represent various
The decimal system, which is most common to us, has a base of 10.
codes or quantities.
The radix or base of a number system determines the total number of
different symbols or digits used by that system. For instance, in the
decimal system, 10 unique numbers or digits—i.e., the digits 0 through
9—are used: the total number of symbols is the same as the base, and
the symbol with the largest value is 1 less than the base.
M. Arslan Bhatti, Department of Math & Stat 4
The value of a decimal number depends on the digits that make up the number
and the place value of each digit. A place (weight) value is assigned to each
position that a digit would hold from right to left. In the decimal system the first
position, starting from the rightmost position, is 0; the second is 1; the third is
2; and so on up to the last position. The weighted value of each position
can be expressed as the base (10 in this case) raised to the power of the
position. For the decimal system then, the position weights are 1, 10, 100,
1000, and so on. Figure 6.1 illustrates how the value of a decimal number can
be calculated by multiplying each digit by the weight of its position and
summing the results.

M. Arslan Bhatti, Department of Math & Stat 5


.2 Binary System
The binary system uses the number 2 as the base. The only allowable digits are
0 and 1. With digital circuits it is easy to distinguish between two voltage levels
(i.e., +5 V and 0 V), which can be related to the binary digits 1 and 0 (Figure
6.2). Therefore, the binary system can be applied quite easily to computer
systems. Since the binary system uses only two digits, each position of a
binary number can go through only two changes, and then a 1 is carried
to the immediate left position.

M. Arslan Bhatti, Department of Math & Stat 6


Table 6.1 shows a comparison among four common number systems: decimal
(base 10), octal (base 8), hexadecimal (base 16), and binary (base 2). Note that all
numbering systems start at zero.
The decimal equivalent of a binary
number can be determined in a
manner similar to that used for a
decimal number. This time the
weighted values of the positions
are 1, 2, 4, 8, 16, 32, 64, and so on.
The weighted value, instead of
being 10 raised to the power of the
position, is 2 raised to the power of
the position.

M. Arslan Bhatti, Department of Math & Stat 7


Figure 6.3 illustrates how the binary number 10101101 is converted to
its decimal equivalent: 173.
Each digit of a binary number is known as a
bit. In a
processor-memory element consists of
hundreds or thousands of locations. These
locations, or registers, are referred to as
words. Each word is capable of storing
data in the form of binary digits, or bits.
Bits can also be grouped within a word
into bytes.
A group of 8 bits is a byte, and a group
of 2 or more bytes is a word.Figure 6.4
illustrates a 16-bit word made up of 2
bytes. The least significant bit (LSB) is
the digit that represents the smallest
value, and the most significant bit (MSB)
is the digit that represents the largest
M. Arslan Bhatti, Department of Math & Stat 8
value. A bit within the word can exist
To convert a decimal number to its binary equivalent, we must perform a series
of divisions by 2. Figure 5.5 illustrates the conversion of the decimal number 47
to binary. We start by dividing the decimal number by 2.

If there is a remainder, it is
placed in the LSB of the binary
number. If there is no remainder,
a 0 is placed in the LSB. The
result of the division is brought
down and the process is
repeated until the result of
successive divisions has been
reduced to 0.
M. Arslan Bhatti, Department of Math & Stat 9
.3 Negative Numbers
If a decimal number is positive, it has a
plus sign; if a number is negative, it has a
minus sign. In binary number systems,
such as computers, it is not possible to
use positive and negative symbols to
represent the polarity of a number. One
method of representing a binary
number as either a positive or
negative value is to use an extra
digit, or sign bit, at the MSB side of the
number. In the sign bit position, a 0
M. Arslan Bhatti, Department of Math & Stat 10
Another method of expressing a negative number in a digital system is by using
the complement of a binary number. To complement a binary number,
change all the 1s to 0s and all the 0s to 1s. This is known as the 1’s complement
form of a binary number. For example, the 1’s complement of 1001 is 0110. The
most common way to express a negative binary number is to show it as a
2’s complement number. The 2’s complement is the binary number that
results when 1 is added to the 1’s complement. This system is shown in
Table 6-3. A zero sign bit means a positive number, whereas a 1 sign bit
means a negative number. Using the 2’s complement makes it easier for
the computer to perform mathematical operations. The correct sign bit is
generated by forming the 2’s complement.
M. Arslan Bhatti, Department of Math & Stat 11
M. Arslan Bhatti, Department of Math & Stat 12
The computer knows that a number retrieved from memory is a negative number
if the MSB is 1. Whenever a negative number is entered from a keyboard, the
computer stores it as a 2’s complement. What follows is the original number in
true binary followed by its 1’s complement, its 2’s complement, and finally, its
decimal equivalent
6.4 Octal System
To express the number in the binary system requires many more digits than in the
decimal system. Too many binary digits can become cumbersome to read or
write. To solve this problem, other related numbering systems are used. The
octal numbering system, a base 8 system, is used because 8 data bits
make up a byte of information that can be addressed. Octal is a
convenient means of handling large binary numbers
M. Arslan Bhatti, Department of Math & Stat 13
As shown in Table 6-4, one octal digit can be used to express three binary digits.
As in all other numbering systems, each digit in an octal number has a
weighted decimal value according to its position. Figure 6.6 illustrates how the
octal number 462 is converted to its decimal equivalent: 306.

M. Arslan Bhatti, Department of Math & Stat 14


Octal converts easily to binary equivalents. For example, the octal number 462 is
converted to its binary equivalent by assembling the 3-bit groups, as illustrated in
Figure 6.7.

M. Arslan Bhatti, Department of Math & Stat 15


6.5 Hexadecimal System
The hexadecimal (hex) numbering system is used in programmable controllers
because a word of data consists of 16 data bits, or two 8-bit bytes. The
hexadecimal system is a base 16 system, with A to F used to represent decimal
numbers 10 to 15 (Table 6.5). The hexadecimal numbering system allows the
status of a large number of binary bits to be represented in a small space, such
as on a computer screen.
The techniques used when converting hexadecimal to decimal and
decimal to hexadecimal are the same as those used for binary and octal.
To convert a hexadecimal number to its decimal equivalent, the
hexadecimal digits in the columns are multiplied by the base 16 weight,
depending on digit significance.
M. Arslan Bhatti, Department of Math & Stat 16
Figure 6.6 illustrates how the
conversion would be done for the hex
number 1B7

M. Arslan Bhatti, Department of Math & Stat 17


Hexadecimal numbers can easily be converted to binary numbers. Conversion
is accomplished by writing the 4-bit binary equivalent of the hex digit for each
position, as illustrated in Figure 6.7

M. Arslan Bhatti, Department of Math & Stat 18


6.6 Binary Arithmetic
Mathematical operations include addition, subtraction, multiplication, and
division. Binary addition follows rules similar to decimal addition. When adding
with binary numbers, there are only four conditions that can occur:

The first three conditions are easy because they are like adding decimals, but
the last condition is slightly different. In decimal, 1 + 1 = 2. In binary, a 2 is
written 10. Therefore, in binary, 1 + 1 = 0, with a carry of 1 to the next most
significant place value. When adding larger binary numbers, the resulting
1s are carried into higher-order columns,
M. Arslan Bhatti, Department of Math &as
Stat shown in the following
19
In arithmetic functions, the initial numeric
quantities
that are to be combined by subtraction are
the minuend
and subtrahend. The result of the subtraction
process is
called the difference, represented as:

To subtract from larger binary numbers,


subtract column by column, borrowing from
the adjacent column when necessary.
Remember that when borrowing from the
adjacent column, there are now two digits,
M. Arslan Bhatti, Department of Math & Stat 20
Binary numbers can also be negative. The
procedure for this calculation is identical
to that of decimal numbers because the
smaller value is subtracted from the
larger value and a negative sign is placed
in front of the result.
M. Arslan Bhatti, Department of Math & Stat 21
There are other methods available for doing subtraction:
1’s complement
2’s complement
The procedure for subtracting numbers using the 1’s
complement is as follows:
Step 1 Change the subtrahend to 1’s complement.
Step 2 Add the two numbers.
Step 3 Remove the last carry and add it to the number (end-
around carry)
When there is a carry at the
end of the result, the result is
positive.
When there is no carry, weM.take
Arslan Bhatti, Department of Math & Stat 22
For subtraction using the 2’s
complement, the 2’s complement is
added instead of subtracting the
numbers. In the result, if the carry
is a 1, then the result is
positive; if the carry is a 0, then
the result is negative and
requires
a minus sign.

M. Arslan Bhatti, Department of Math & Stat 23


REVIEW QUESTIONS
1. Convert each of the following 2. Convert each of the following
binary numbers to decimal numbers to
decimal numbers: binary numbers:
a. 10 a. 7
b. 100 b. 19
c. 111 c. 28
d. 1011 d. 46
e. 1100 e. 57
f. 10010 f. 86
g. 10101 g. 94
h. 11111 h. 112
i. 11001101 i. 148
j. 1110001 j. 230

M. Arslan Bhatti, Department of Math & Stat 24


3. Convert each of the following octal 4. Convert each of the following octal
numbers to numbers to
decimal numbers: binary numbers:
a. 36 a. 74
b. 104 b. 130
c. 120 c. 250
d. 216 d. 1510
e. 360 e. 2551
f. 1516 f. 2634
5. Convert each of the following hexadecimal 6. Convert each of the following hexadecimal
numbers to decimal numbers: numbers to binary numbers:
a. 5A a. 4C
b. C7 b. E8
c. 9B5 c. 6D2
d. 1A6 d. 31B

M. Arslan Bhatti, Department of Math & Stat 25


10. Express the decimal number 18 in each of
7. Add the following binary numbers:
the following number codes:
a. 110 + 111 a. Binary
b. Octal
b. 101 + 011
c. Hexadecimal
c. 1100 + 1011
8. Subtract the following binary numbers:
a. 1101 − 101
b. 1001 − 110
c. 10111 − 10010

9. Convert each piece of binary information to


the appropriate hexadecimal code
a. 0001 1111
b. 0010 0101
c. 0100 1110
d. 0011 1001 M. Arslan Bhatti, Department of Math & Stat 26
Units and their conversions

M. Arslan Bhatti, Department of Math & Stat 27


Metric units of measurement
• Length – a measure of distance
• Millimetre - mm
• Centimetre - cm
• Metre - m
• Kilometre - km
• Mass – linked to weight
• Gram - g
• Kilogram - kg
• Tonne - t
• Capacity – the amount of liquid a 3D shape will hold
• Millilitre -
• Centilitre -
• Litre -
M. Arslan Bhatti, Department of Math & Stat 28
1. Write down which metric unit of length you would
use to measure each of these items:
a) Length of a bedroom d) Width pen nib mm
M
b) Length of a river Km
e) Height of a mountain
Km
c) Length of a needle f) Distance from Leeds to
Mm York km
2. Which metric unit would you use to weigh each item
listed below?
a) Man kg c) Delivery van t
b) Letter g d) Tin of tuna g
3. Which metric unit would you use to measure the
capacity of each container listed below?
a) Large bottle of pop
cl c) Bottle of shampoo ml
b) Carton of cream ml d) Paddling pool l
M. Arslan Bhatti, Department of Math & Stat 29
Metric conversions

10mm = 1cm
100cm = 1m
1000m = 1km
1000g = 1kg
1000kg = 1 tonne
1000ml = 1 litre
100cl = 1 litre

M. Arslan Bhatti, Department of Math & Stat 30


Converting between units

X 10 X 100 X 1000
cm mm m cm km m
÷ 10 ÷ 100 ÷ 1000

X 1000 X 1000

kg g l ml
÷ 1000 ÷ 1000

M. Arslan Bhatti, Department of Math & Stat 31


Converting metric units
• 20mm = _________ cm
• 450mm = _________ m
• 0.5cm = _________ mm
• 6000g = _________ kg
• 2500kg = _________ t
• 400cm = _________ m
• 4000m = _________ km
• 4.5kg = _________ g
• 6500g = _________ kg
• 3 litres = _________ml
M. Arslan Bhatti, Department of Math & Stat 32
More exercises …
1) 5.9m = ….cm 590cm 11)4 litres = ….ml 4000ml
2) 43mm = ….cm 4.3cm 12)509g = ….kg 0.509kg
3) 2.4kg = ….g 2400g 11)63 litres =
63000m
4) 7.4 litres = ….ml7400ml ….ml l
5) 9.5kg = ….g 9500g 13)1400ml = …. 1.4l
6) 70cm = ….m 0.7m Litres 3500m
7) 300mm = ….m 0.3m
14)3.5km = ….m 2.5t
8) 600ml = ….l 15)2500kg = ….t
0.6l 30cm
9) 3g = ….kg 16)0.3m = ….cm
0.003k 3700m
10)700g = ….kg g 17)3.7m = ….mm m
0.7kg 18)5.02kg = ….g 5020g
19)10.3cm = 103cm
Show any calculations that….mm you do to work out
M. Arslan Bhatti, Department of Math & Stat 33
the answer
What is conversion of units?
• The conversion of units allows unit conversion to take
place between metric and imperial units of measurement
for units of length, area and volume, and between
seconds, minutes and hours.
• The metric system of units of measurement is based on
powers of 10. Prefixes such as kilo and milli are used to
indicate which power of 10 is involved.
• 1 km=1000 m
• 1 m=100 cm
• 1 m=1000 mm
• 1 cm=10 mm
M. Arslan Bhatti, Department of Math & Stat 34
What is conversion of units?
• The imperial system is an older system of measurements,
but some are still used in everyday life. e.g.
• 1 foot = 12 inches
• 3 feet = 1 yard
• 1760 yards = 1 mile
• Time uses a sexagesimal system based on the number 60
• There are 60 seconds in 1 minutes.
• There are 60 minutes in 1 hour.
• The SI (the international system of units) unit for time is the
second

M. Arslan Bhatti, Department of Math & Stat 35


Your Role …

You are expected to convert between the


different systems of measurements
including units of time, metric units and to
convert between metric and imperial units.

M. Arslan Bhatti, Department of Math & Stat 36


Inches  centimeters
• If we go from inches to centimetres
we multiply by the conversion
factor.

• If we go from centimetres to inches


we divide by the conversion factor.

• Note: we use the ≈ symbol which


means “approximately equal to”.

M. Arslan Bhatti, Department of Math & Stat 37


Example

M. Arslan Bhatti, Department of Math & Stat 38


Currency conversion
• The skills for the conversion of units can also be applied to
currency conversion. Different countries use different
currencies. How currencies are linked are known as
the exchange rate. E.g.
• The exchange rate is: $1 = PKR.277.70
• Work out how many American dollars is RS. 80,000.

M. Arslan Bhatti, Department of Math & Stat 39


Units of length
• The conversion factor is a
number we can use to
change one set of units to
another, by multiplying or
dividing. We can convert units
of lengths by remembering
the most common metric unit
conversions
Ex.1: Can you convert 400cm into meters??????
Ex.2: Ali runs 500m every day. How many km Ali runs in a
week?
M. Arslan Bhatti, Department of Math & Stat 40
Answers

M. Arslan Bhatti, Department of Math & Stat 41


Units of time
• We can convert units of time
by remembering the most
common unit conversions:

M. Arslan Bhatti, Department of Math & Stat 42


Units of area

M. Arslan Bhatti, Department of Math & Stat 43


Density, mass and
Volume
• Volume measures the space
inside a three-dimensional
object. In ascending order of
size, the most common units
of volume are

M. Arslan Bhatti, Department of Math & Stat 44


Units of volume

M. Arslan Bhatti, Department of Math & Stat 45


Rates, Ratios Proportions and
Percentages

M. Arslan Bhatti, Department of Math & Stat 46


Ratios, Rates
and
Proportions

M. Arslan Bhatti, Department of Math & Stat 47


Cross products

M. Arslan Bhatti, Department of Math & Stat 48


Example

M. Arslan Bhatti, Department of Math & Stat 49


M. Arslan Bhatti, Department of Math & Stat 50
M. Arslan Bhatti, Department of Math & Stat 51
M. Arslan Bhatti, Department of Math & Stat 52
Examples
• In a school, the ratio of boys to girls is 3:2. There are 312 boys.
How many girls are there?
Ans: 208 girls

M. Arslan Bhatti, Department of Math & Stat 53


M. Arslan Bhatti, Department of Math & Stat 54
M. Arslan Bhatti, Department of Math & Stat 55
Part-to-Part Ratio
Part-to-Part Ratio
• Content: A part-to-part ratio compares one part of a whole to
another part.
• Example:
• 3 red apples and 5 green apples.
• Ratio: Red apples : Green apples = 3 : 5
• This means, for every 3 red apples, there are 5 green apples.

M. Arslan Bhatti, Department of Math & Stat 56


Part-to-Whole Ratio
• Content: A part-to-whole ratio compares one part of the
whole to the total.
• Example:
• 3 red apples and 5 green apples (total of 8 apples).
• Ratio: Red apples : Total apples = 3 : 8
• This means, 3 red apples are 3 out of 8 apples.

M. Arslan Bhatti, Department of Math & Stat 57


Ratio - example
• Ratio Example:
• Definition: A ratio compares two quantities of the same kind.
• Example:
In a classroom, there are 6 boys and 4 girls.
The ratio of boys to girls is:
Ratio=Boys/Girls = 6/4 =3:2

This means, for every 3 boys, there are 2 girls.

M. Arslan Bhatti, Department of Math & Stat 58


Rate - example
• A car travels 150 kilometers in 3 hours.
The speed (rate) is:

Rate = Distance / Time = 150 km / 3 hours = 50 km/hour

This means the car is traveling at a rate of 50 kilometers per


hour.

M. Arslan Bhatti, Department of Math & Stat 59


Proportion - example

• If 3 apples cost $6, how much


would 5 apples cost at the
same rate?

• We can set up the proportion:


So, the cost of 5 apples is
$10.

M. Arslan Bhatti, Department of Math & Stat 60


M. Arslan Bhatti, Department of Math & Stat 61
M. Arslan Bhatti, Department of Math & Stat 62
Exercises
Ratio Exercise:
• A recipe calls for 2 cups of sugar and 3 cups of flour to make a batch of cookies.
You want to make the cookies with 6 cups of flour. How many cups of sugar will
you need to maintain the same ratio of sugar to flour?
Rate Exercise:
• A car travels a distance of 240 kilometers in 4 hours. What is the average speed
(rate) of the car in kilometers per hour?
Proportion Exercise:
• A company manufactures 15 units of product A using 10 hours of labor. Another
company claims that they can produce 20 units of product A in 12 hours. Is the
labor efficiency of the second company the same as the first company? If not,
what is the difference in efficiency?
• We're making cookies, and the recipe calls for 1 cup of sugar for every 3 cups of
flour. What if we want to use 9 cups of flour: how much sugar do we need?
M. Arslan Bhatti, Department of Math & Stat 63
Types and Source of Data
Measurement Scales
Tabular and Graphical
Representation of data

M. Arslan Bhatti, Department of Math & Stat 64


What is Statistics?
Statistics is the art and science of extracting
information from data
Statistics
Data Information

Data: Raw facts Information:


and figures, Communicated
especially concerning some
numerical facts, particular facts.
collected
together for
information.

M. Arslan Bhatti, Department of Math & Stat 65


Why study statistics?
1. Data are everywhere
2. Statistical techniques are used to make many decisions
that affect our lives
3. No matter what your career, you will make professional
decisions that involve data. An understanding of
statistical methods will help you make these decisions
Statistics
efectivelyis a field that includes methods for
planning studies or surveys, gathering,
organizing, summarizing, displaying, and
analyzing data. It helps us make informed
conclusions about a larger group (population)
M. Arslan Bhatti, Department of Math & Stat 66
Variation and Uncertainty
• Statistics is the subject which deals with the
variability. No two objects in a universe are exactly
alike. If they were, there would have been no statistical
problem.

• It also deals with uncertainty as every process of


getting observations whether controlled or
uncontrolled, involves deficiencies or chance variation.
That is why we have to talk in terms of probability since
the inferences which are made about the population on
the basis of sample evidence cannot be absolutely
certain. M. Arslan Bhatti, Department of Math & Stat 67
Population vs Sample
Statistical
Inference

Population
Sample
(have Parameters) (have
Statistic)
Parameters: µ, Statistic: , S, r
σ, ρ
Population: A Sample: A
Population is a group representative
of all part/subset of the
object/elements/item population.
s under investigation. M. Arslan Bhatti, Department of Math & Stat 68
Why Sampling?
• A process of drawing a sample from population is
called sampling.
• Reduced cost
• Greater speed
• Greater accuracy
• Some times it is the only option (testing the life of
bulbs/bullets)

M. Arslan Bhatti, Department of Math & Stat 69


Branches of Statistics

Statistics

Descriptive Inferential

Descriptive statistics are brief


Using sample
descriptive coefficients that
summarize a given data set, which can information such as ,
be either a representation of the entire S, r, p to draw
or a sample of a population. Inference about
Descriptive statistics are broken Unknown Population
down into measures of central
Parameters.
tendency and measures of variability
M. Arslan Bhatti, Department of Math & Stat 70
(spread).
Any Characteristics that varies from Object to Object,
Variable Place to Place or Over time is known as Variable. e.g.,
marks, age, height, sex, temperature, sales, revenue,
time etc.
Variabl
e

Qualitativ Quantitati
e ve
Characteristic which
varies in quality Continu
Discrete
(not numerically) ous
e.g., Height
No. of students
Eye colour, Weight
No. of chairs
Education level, Marks
No. of deaths
Behaviour, Time
No. of births in a
Quality, Distance
hospital
Design, Temperatu
No.Arslanof accidents
Performance
M. Bhatti, Department of Math & Stat
re 71
Exercise of type of variables
• A school is conducting a survey to understand students'
academic performance, interests, and demographic
information. They collect data on the following variables:
1.Age of students
2.Favorite subject (Math, Science, English, History)
3.Number of classes attended per week
4.Student's grade level (e.g., Grade 1, Grade 2, etc.)
5.Average test score
6.Participation in extracurricular activities (Yes/No)

Identifying the Types of Variables


M. Arslan Bhatti, Department of Math & Stat 72
Another exercise
A software company is conducting a study on the usage patterns and
specifications of employees' computers to optimize performance. They collect
data on the following variables:
1. Computer brand (e.g., Dell, HP, Apple, Lenovo)
2. Processor speed (in GHz)
3. Amount of RAM (in GB)
4. Operating system (e.g., Windows, macOS, Linux)
5. Hours of usage per day
6. Is the computer used for gaming? (Yes/No)
7. Screen size (in inches)
8. Primary use of the computer (e.g., Development, Design, General Office, Data Analysis)
9. Number of software applications installed
10. Years since purchase

Identify the type of variable for each of the variables listed above.
M. Arslan Bhatti, Department of Math & Stat 73
Measurement

• The concept of measurement scales was introduced by


psychologist Stanley Smith Stevens in 1951.
• He developed a framework to classify data based on how
numbers or labels are assigned to represent attributes or
characteristics of objects, people, states, or events.
• His classification identifies four levels of measurement:
nominal, ordinal, interval, and ratio, each reflecting
different properties and relationships among data points.
This system allows researchers to determine the most
suitable analytical methods based on the scale of
measurement.
M. Arslan Bhatti, Department of Math & Stat 74
Measurement Scales
• Measurement scales refer to the system used to categorize
and quantify variables based on the relationship between
values. Stanley Smith Stevens defined four types of
measurement scales: Nominal, Ordinal, Interval, and Ratio.
Each scale has specific characteristics and influences how data
is analyzed. Let’s look at each scale in detail with examples,
including general scenarios and those specific to computer
science.

M. Arslan Bhatti, Department of Math & Stat 75


Nominal
• The nominal scale is the simplest type of measurement. It
categorizes data into distinct groups or categories without any
quantitative value or order.

• Nominal scales are mutually exclusive (non-overlapping)


categories where order of the categories is not important.

• Only distinguishes between categories


• No inherent order among the categories
• Suitable for labeling and counting frequencies

Examples: Sex, Blood Groups, Religion, Marital status, Political affiliation, Eye color
Programming Languages: Categories like Python, Java, C++, and JavaScript.
Operating System: Categories like Windows, macOS,
M. Arslan Bhatti, Linux,
Department and
of Math Android.
& Stat 76
Ordinal
• Order of the values is important and significant, but the
differences between each one is not really known.
Poor  Fair  Good  Very Good  Excellent

• But, Is the difference between “Very Good” and “Excellent” the


same as the difference between “Good” and “Very Good?” We
can’t say.

Example:
Students’ Grades
Class Positions
Cricket teams standings in Bhatti,
M. Arslan ICCDepartment
rankingof Math & Stat 77
Ordinal …continue
• The ordinal scale categorizes data with a meaningful order or
rank among categories but without precise intervals between
them.
• Data can be ordered or ranked.
• Differences between ranks are not consistent or measurable.
• Example: Education Level: Categories include High School,
Bachelor’s, Master’s, PhD. (There is an order, but the difference
in years of study or expertise between each level is not uniform)
• Example: User Access Levels: Categories like Guest, User,
Moderator, Administrator. (These represent a hierarchy of
permissions, though not with equal intervals between levels).

M. Arslan Bhatti, Department of Math & Stat 78


Interval
• Interval scales are numeric scales in which we know not only
the order, but also the exact differences between the values.
i.e., Constant interval size
• No “true zero” point i.e., Zero does not mean absence

• With interval data, we can add and subtract, but cannot


multiply or divide.
Example:
Temperature
Shoe size
IQ scores
M. Arslan Bhatti, Department of Math & Stat 79
Ratio
• Ratio scales tell us about the order, they tell us the exact
value between units, AND they also have a “true zero”
point

Example:
Height, Weight, Speed, Length, Age
Storage Capacity: Measured in bytes, a storage capacity of 0 GB
means no storage. A 500 GB hard drive has twice the capacity of a
250 GB hard drive.
Memory Usage: Memory measured in MB or GB where 0 means no
memory usage. 8 GB of RAM is twice as much as 4 GB
M. Arslan Bhatti, Department of Math & Stat 80
Just look at some of the Graphs …

M. Arslan Bhatti, Department of Math & Stat 81


Line
chart
with
respect
to time

M. Arslan Bhatti, Department of Math & Stat 82


Bar chart

M. Arslan Bhatti, Department of Math & Stat 83


Multiple
bar chart

Cluster bar
chart

M. Arslan Bhatti, Department of Math & Stat 84


A histogram is a type of chart that
represents the distribution of a
numeric (continuous) variable by
grouping the data into bins (intervals)
and displaying the frequency or count
of data points within each bin. Unlike a
bar chart, which typically represents
categorical data, a histogram isBhatti,
M. Arslan used Department of Math & Stat 85
• Age (years)
• Weight (kilograms)
• Height (centimeters)
• Temperature (degrees Celsius)
• Time Spent on a task (minutes)
• Scores on a test
• Distance traveled (kilometers)
• Salary (dollars)
• Calories Consumed (calories)
• Rainfall (millimeters)
• CPU Usage (percentage)
• RAM Usage (GB)
• Response Time (milliseconds)
• Download Speed (Mbps)
• File Size (MB)Disk Read/Write Speed (MB/s)
• Battery Life (hours)
• Execution Time (seconds)
• Network
M. Arslan Bhatti, DepartmentBandwidth
of Math & Stat (Mbps) 86
Lets learn to make these at you own…

M. Arslan Bhatti, Department of Math & Stat 87


Qualitative data
Example 1: Consider the data about Sex of 10 students

Sex M F M M F M F M M M

• Make a frequency distribution, relative frequency and % frequency


of the above data and interpret your results? Make an appropriate
graph?
Example 2: Suppose we have also collected data of Sections
of these
Sex 10 M students
F M asM F M F M M M
Sectio A A A B B B A B A B
n
• Construct the Cross tabulation of the above data and interpret your
results? Also make an appropriate graph?
M. Arslan Bhatti, Department of Math & Stat 88
Solution
Example Sex f Relativ % Example Sex Sec Sec B Total
1 e freq freq 2 A
Male 7 0.7 70 Male 3 4 7
Femal 3 0.3 30 Femal 2 1 3
e e
Total 10 1.0 100 Total 5 5 10
Bar Chart Multiple Bar chart
8
7 5
7
6 4
Frequency

Frequency
5 Sec A
3
4
3 2
Sec B
3
2 1
1
0
0 Male Female
Male Female
Sex
Sex M. Arslan Bhatti, Department of Math & Stat 89
Simple Bar Chart
• A bar chart is a type of chart which shows the values
of different categories of data as rectangular bars with
different lengths.
Example: Draw a Simple Bar Chart to represent the
Bar diagram
Population of 5 cities of the province Punjab.showing Popu-
Cities Population lation of 5 cities of Punjab
(000) 12,000 10,355

Population in ‘000’
10,000
Lahore 10,355 8,000
6,000 4,765
Rawalpin 4,765 4,000
3,675 3,100
2,000 1,550
di 0
e i d a n
Faisalaba 3,675 h or
p ind
ab
a
od
h
u lta
La al a l
r g M
d R aw F ai
s
S a

Sargodha 1,550 M. Arslan Bhatti, Department of Math & Stat Cities 90


Multiple Bar Chart

Population Femal
Cities (000) Male e Multiple Bar Chart showing
Population of Males and
Lahore 10,355 5385 4,970 6000
5385 Females
4,970
Rawalpindi 4,765 2478 2,287 5000 Males Females
Faisalabad 3,675 1911 1,764 4000

Population
Sargodha 1,550 806 744 3000
2478
2,287
1911
1,764
2000

1000 806744

0
Lahore Rawalpindi Faisalabad Sargodha

M. Arslan Bhatti, Department of Math & Stat Cities 91


Component Bar Chart

Pop Component Bar Chart showing


Cities (000) Male Female population of both Males and
12000 Females and Total
Lahore 10,355 5385 4,970
10000 Males
Rawalpindi 4,765 2478 2,287
8000
Females
4,970

Population
Faisalabad 3,675 1911 1,764
6000

Sargodha 1,550 806 744 4000


2,287
5385 1,764
2000
2478 1911 744
0
806
Lahore Rawalpindi Faisalabad Sargodha

M. Arslan Bhatti, Department of Math & Stat


Cities 92
Discrete data – Frequency Distribution

Example:
• Following data represents the number of infected plants
from a sample of twenty experimental plots. Your task is
to present it in tabular form.

1 2 4 3 0 1 2 3 1 1 0
2 1 0 2 3 0 0 1 3

M. Arslan Bhatti, Department of Math & Stat 93


Discrete Frequency Distribution
No. of infected Tally Frequency Relative
items frequency
f
X
0 |||| 5 5/20 = 0.25
1 |||| | 6 0.30
2 |||| 4 0.20
3 |||| 4 0.20
4 | 1 0.05
Total 20 1.00

M. Arslan Bhatti, Department of Math & Stat 94


Graphical Representation of Discrete Data

Bar Chart representing the infected


7
items
6
6
5
5
Frequency

4
4 4
3

1
1
0
0 1 2 3 4
No. of infected items
M. Arslan Bhatti, Department of Math & Stat 95
Pie Chart
• A pie chart is a type of graph in which a circle is
divided into sectors that each represent a proportion of
the whole.
Example: The blood group of 70 students were tested
and the following results were obtained.
Blood No. of Blood Groups of
Groups Students Students
(f)
A 8 A
17% 11% B
B 30 O
AB
29%
O 20 43%

AB 12
M. Arslan Bhatti, Department of Math & Stat 96
Pie Chart
Blood No. of Relative Percent Angle
Groups Student frequenc frequency rf x 360
s (f) y
A 8 8/70 = 0.11*100 = 39.6
0.11 11
B 30 43 154.8
0.43
104.4
Divide the total
O 20 29
0.29 angle of the
AB 12 61.2 Circle 360 into
0.17 17
four segments
Total 70 100 360 as calculated
1.00

M. Arslan Bhatti, Department of Math & Stat 97


Simple Bar Chart
• Consider the Same example of the blood group of 70 students

Blood No. of Blood Groups


35
Groups Students 30
(f) 30

A 8 25
20
20
B 30
15 12
O 20
10 8
AB 12 5
0
A B O AB

M. Arslan Bhatti, Department of Math & Stat 98


Simple Bar Chart

Example: Draw a Simple Bar Chart to represent the


turnover of a company for 6 years.
Bar diagram showing the Turnover of a
Years Turnover company for 6 years
(Rs) 70,000
60,000
2002 25,000

Turnover in Rs.
50,000
2003 29,000 40,000
2004 44,000 30,000
2005 49,000 20,000

2006 60,000 10,000


0
2007 64,000 2002 2003 2004 2005 2006 2007

M. Arslan Bhatti, Department of Math & Stat Years 99


Obtaining Data
Published source
book, journal, newspaper, Published reports
Designed experiment
researcher exerts strict control over units
Survey
a group of people are surveyed and their responses are recorded
Administrative Records

M. Arslan Bhatti, Department of Math & Stat 100


we will be dealing with various techniques for summarizing and describing
qualitative data.

Qualitative

Univariate Bivariate
Frequency Frequency
Table Table

Percentages
Component Multiple
Pie Chart Bar Chart Bar Chart

Bar Chart

We will begin with the univariate situation, and will proceed to the
bivariate situation.
M. Arslan Bhatti, Department of Math & Stat 101
Frequency Distribution &
Histogram

M. Arslan Bhatti, Department of Math & Stat 102


Following data Classes Frequency c.f. r.f. % freq
represents the plant (f)
height (cm) of a 86–90 6 6 0.200 20.0
sample of 30 plants. 91–95 4 10 0.133 13.3
87 91 89 96–100 10 20 0.333 33.3
88 89 91 101–105 6 26 0.200 20.0
87 92 90
106–110 3 29 0.100 10.0
98 95 97
96 100 101 111–115 1 30 0.033 3.3
96 98 99 Total 30 1.000 100.0
98 100 102
99 101 105 Histogram
103 107 105 12
10
106 107 112 10
Frequenc 8
y Frequency 6
6 6

distributi 4
4
3
on & 2 1
Histogra 0
85.5–90.5 90.5–95.5 95.5–100.5 100.5–105.5 105.5–110.5 110.5–115.5
m Class Boundries
M. Arslan Bhatti, Department of Math & Stat 103
Frequency Distribution
• Tabular arrangement of data in which various items
are arranged into classes or groups and the number of
items falling in each class is stated.
• The number of observations falling in a particular class
is referred to as class frequency "f".
• Data presented in the form of a frequency distribution
is also called grouped data.

M. Arslan Bhatti, Department of Math & Stat 104


Some definitions
Class Limits
• The class limits are defined as the number or the values of the
variables which are used to separate two classes. Sometimes classes
are taken as 20--25, 25--30 etc In such a case, these class limits
means " 20 but less than 25", "25 but less than 30" etc
Class marks or midpoints
• The class mark or the midpoint is that value which divides a class
into two equal parts. It is obtained by dividing the sum of lower and
upper class limits or class boundaries of a class by 2.
Class interval
• The difference between either two successive lower class limits or
two successive upper class limits OR
• The difference between two successive midpoints.
M. Arslan Bhatti, Department of Math & Stat 105
Example

• The following data represents the height of 30 wheat plants


taken from the experimental area. Construct a frequency
distribution and appropriate graphs to explain the
distribution of data:

87 91 89 88 89 91 87 92 90 98 95
97 96 100 101 96 98 99 98 100 102 99 101
105 103 107 105 106 107 112

M. Arslan Bhatti, Department of Math & Stat 106


Construction of a frequency distribution
• Decide the number of classes:
K=1+3.3 log(n)=5.87 or =5.47  6 Classes
• Determine the range of variation of the data i.e,
R= Max – Min = 112 – 87 = 25
• Determine the approximate size of class interval
= 25/6 = 4.17  5 Class Interval
• Decide where to locate the class limits  86-90, 91-95, …
• Distribute the data into appropriate classes

M. Arslan Bhatti, Department of Math & Stat 107


Frequency Distribution
Classes Class Tally Freq (f) c.f. r.f. % freq Cumulative
Boundaries % freq

86–90 85.5–90.5 6 6 0.200 20.0 20.00


91–95 90.5–95.5 4 10 0.133 13.3 33.3
96–100 95.5–100.5 10 20 0.333 33.3 66.6
101–105 100.5–105.5 6 26 0.200 20.0 86.6
106–110 105.5–110.5 3 29 0.100 10.0 96.6
111–115 110.5–115.5 1 30 0.033 3.3 100.0
Total 30 1.000 100.0

M. Arslan Bhatti, Department of Math & Stat 108


Class Boundaries

• Class Boundaries
• Subtract any Upper Class Limit from its Subsequent Lower
Class limit and divide the difference with 2, you will get the
Continuity correction factor
• Subtract this factor from all Lower Class Limits and add it to
all Upper Class limits.

For example, 91-90 = ½ =0.05 or 96-95 = ½ =0.05

M. Arslan Bhatti, Department of Math & Stat 109


Histogram
Histogram of Height of 30 Students
12
10
10

8
Frequency

6 6
6
4
4
3
2
1
0
85.5–90.5 90.5–95.5 95.5–100.5 100.5–105.5 105.5–110.5 110.5–115.5

Class Boundries
M. Arslan Bhatti, Department of Math & Stat 110
Frequency Polygon

• Frequency polygons are a graphical device for


understanding the shapes of distributions. They serve the
same purpose as histograms, but are especially helpful
for comparing sets of data.
Frequency Polygon
• Mid Points vs Frequency 12

10

Frequency
6

0
88 93 98 103 108 113
M. Arslan Bhatti, Department of Math & Stat Mid Points 111
Cumulative Frequency Polygon / Ogive

• A cumulative frequency polygon is a plot of


the cumulative frequency against the upper class
boundary with the points joined by a line segment.
• Upper Class Boundaries vs Cumulative Frequency
Cumulative Frequency Polygon / Ogive
35
30

Cumulative Frequency
25
20
15
10
5
0
90.5 95.5 100.5 105.5 110.5 115.5
M. Arslan Bhatti, Department of Math & Stat Upper Class Boundaries 112
Stem & Leaf Display
• A relatively small data set can be represented by stem and
leaf display.
• In addition to information on the number of observations
falling in the various classes, it displays details of what those
observations actually are.
• Each number in the data set is divided into two parts, a Stem
and a Leaf. A stem is the leading digit(s) of each number and
is used in sorting, while a leaf is the rest of the number or the
trailing digit(s) and shown in display.

M. Arslan Bhatti, Department of Math & Stat 113


Example
Use the data below to Stem Leaf
make a stem-and-leaf plot
by taking 10 as a unit. 7 0589
85 115 126 92 104 8 4558
85 116 100 121 123 9 022379
79 90 110 129 108
10 0478
107 78 131 114 92
11 04566
131 88 97 99 116
93 84 75 70 132
12 1369
13 112

7 0589
These values are 70, 75, 78 and 79
M. Arslan Bhatti, Department of Math & Stat 114
Example
Represent the following data by Stem and Leaf display
by
(i) taking 10 unit as the width of the class
(ii) taking 5 unit as the width of the class
32 45 38 41 49 36 52 56 51 62 63 59
68 Steam Leaf *indicate 0—4
Steam Leaf 3* 2 .indicate 5—9
3. 8 6
3 2 8 6 4* 1
4. 5 9 * and . are called placeholder
4 5 1 9
5* 2 1
5 2 6 1 9 5. 6 9
6* 2 3
6 2 3 8 6. 8
M. Arslan Bhatti, Department of Math & Stat 115
Example
Minimum value = 8 Maximum value = 112
Stem unit = 10 Width of class = 10 Arranged stem and leaf table

Stem Leaf Stem Leaf


8 98797 8 77899
9 1120857668989 9 0112566788899
10 01021537567 10 00112355677
11 2 11 2

M. Arslan Bhatti, Department of Math & Stat 116


Example of Stem & Leaf display –
Class Width
Example
= 5
Width of class = 5

Stem Leaf
8* -
8. 79897
9* 1120
9. 857668989
10* 010213
10. 57567
11* 2
11. -

* Indicates 0-4 . Indicates 5-9 [(*, .) are called place holder]


M. Arslan Bhatti, Department of Math & Stat 117
Back to Back Stem and Leaf display
• Two data sets can be compared using Back-to-Back stem and
leaf display. In this case a single stem is constructed and the
values of one data set are assigned on the left and the value
of second data set are assigned on the right of the stem.

Example: Compared using Back-to-Back stem and leaf display

Data 1) 32, 45, 38, 41, 49, 36, 52, 56, 51, 62, 63, 59, 68
Data 2) 23, 58, 26, 57, 55, 65, 29, 36, 59, 69, 60

M. Arslan Bhatti, Department of Math & Stat 118


Data 1 Data 2
32 = Mini.value = 23
68 = Maxi.value = 69
Stem unit = 10 Width of class = 10

Data 1 Data 2
(#13) (# 11)
Leaf Leaf
2 369
682 3 6
915 4
9162 5 8759
832 6 590
M. Arslan Bhatti, Department of Math & Stat 119
Exercises

M. Arslan Bhatti, Department of Math & Stat 120

You might also like