DAF 1104 Q. Methods Teaching Notes
DAF 1104 Q. Methods Teaching Notes
Definition of a set:
For instance, - Set of all courses offered at the School of Business, University of Nairobi.
Types of Sets
The sets are further categorised into different types, based on elements or types of elements.
These different types of sets in basic set theory are:
Equal set: Two sets are equal if they have same elements
Equivalent set: Two sets are equivalent if they have same number of elements
Universal set: Any set that contains all the sets under consideration.
Subset: When all the elements of set A belong to set B, then A is subset of B
There are several symbols that are adopted for common sets. They are given in the table below:
Represents the set of all Natural numbers i.e. all the positive integers.
1
Represents the set of all integers
The symbol is derived from the German word Zahl, which means number.
Z
Positive and negative integers are denoted by Z+Z+ and Z−Z− respectively.
The symbol is derived from the word Quotient. It is defined as the quotient of two integers
Q (with non-zero denominator)
Positive and negative rational numbers are denoted by Q+Q+ and Q−Q− respectively.
Represents the Real numbers i.e. all the numbers located on the number line.
R Positive and negative real numbers are denoted by R+R+ and R−R− respectively.
Other Notations
{} Set
A∪B A union B
A∩B A intersection B
A⊆B A is subset of B
2
A⊄B A is not subset B
A⊇B Superset
Ø empty set
Ac Complement of A
a∈B a element of B
n( A ∪ B ) = n(A) +n(B) – n (A ∪ B)
n(U)=n(A)+n(B)–n(A∩B)+n((A∪B)c)
n(A∪B)=n(A−B)+n(B−A)+n(A∩B)
n(A−B)=n(A∩B)−n(B)
3
n(A−B)=n(A)−n(A∩B)
n(Ac)=n(U)−n(A)
n(PUQUR)=n(P)+n(Q)+n(R)–n(P⋂Q)–n(Q⋂R)–n(R⋂P)+n(P⋂Q⋂R)
Set Operations
The four important set operations that are widely used are:
Union of sets
Intersection of sets
Complement of sets
Difference of sets
Like addition and multiplication operation in algebra, the operations such as union and
intersection in set theory obeys the properties of associativity and commutativity. Also, the
intersection of sets distributes over the union of sets.
Sets are used to describe one of the most important concepts in mathematics i.e. functions.
Everything that you observe around you, is achieved with mathematical models which are
formulated, interpreted and solved by functions.
Q.1: If U = {a, b, c, d, e, f}, A = {a, b, c}, B = {c, d, e, f}, C = {c, d, e}, find (A ∩ B) ∪ (A ∩
C).
A∩B={c}
A ∩ C = { a, b, c } ∩ { c, d, e }
A∩C={c}
∴ (A ∩ B) ∪ (A ∩ C) = { c }
Q.3: If U = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, A = {3, 5, 7, 9, 11} and B = {7, 8, 9, 10, 11}, Then
find (A – B)′.
A – B = {3, 5}
According to formula,
(A − B)′ = U – (A – B)
For more set theory rules, formulas and examples, register with us. To watch videos and
understand the concepts, download BYJU’S-The Learning App from Google Play Store.
Set theory defines the collection of objects, where the order of objects does not matter. It relates
with the collection of group of members or elements in mathematics or in real world.
The different types of sets are finite and infinite sets, subset, power set, empty set or null set,
equal and equivalent sets, proper and improper subsets, etc.
5
For three sets, P, Q and R, the formula is given by;
n(PUQUR)=n(P)+n(Q)+n(R)–n(P⋂Q)–n(Q⋂R)–n(R⋂P)+n(P⋂Q⋂R)
A singleton set has only one element. Example are {1}, {a}, {x:x is an integer that has only one
factor}, etc.
Sets can be represented in two different ways: Roster form and Set-builder form
1. Let A and B be two finite sets such that n(A) = 20, n(B) = 28 and n(A ∪ B) = 36, find n(A ∩
B).
Solution:
= 20 + 28 - 36
= 48 - 36
= 12
Solution:
70 = 18 + 25 + n(B - A)
70 = 43 + n(B - A)
n(B - A) = 70 - 43
n(B - A) = 27
= 52
3. In a group of 60 people, 27 like cold drinks and 42 like hot drinks and each person likes at
least one of the two drinks. How many like both coffee and tea?
Solution:
Given
= 27 + 42 - 60
= 69 - 60 = 9
=9
4. There are 35 students in art class and 57 students in dance class. Find the number of students
who are either in art class or in dance class.
• When two classes meet at different hours and 12 students are enrolled in both activities.
Solution:
(i) When 2 classes meet at different hours n(A ∪ B) = n(A) + n(B) - n(A ∩ B)
= 35 + 57 - 12
7
= 92 - 12
= 80
(ii) When two classes meet at the same hour, A∩B = ∅ n (A ∪ B) = n(A) + n(B) - n(A ∩ B)
= n(A) + n(B)
= 35 + 57
= 92
5. In a group of 100 persons, 72 people can speak English and 43 can speak French. How many
can speak English only? How many can speak French only and how many can speak both
English and French?
Solution:
Given,
= 72 + 43 - 100
= 115 - 100
= 15
8
⇒ n(A - B) = n(A) - n(A ∩ B)
= 72 - 15
= 57
= 43 - 15
= 28
Word problems on sets using the different properties (Union & Intersection):
Solution
Given,
n(A ∪ B ∪ C) = 45 n(A ∩ B ∩ C) = 4
We know that number of elements belonging to exactly two of the three sets A, B, C
9
Therefore, n(A ∩ B) + n(B ∩ C) + n(A ∩ C) = n(A) + n(B) + n(C) + n(A ∩ B ∩ C) - n(A ∪ B ∪
C)
= 36 + 12 + 18 + 4 - 45 - 12
= 70 - 57
= 13
7. Each student in a class of 40 plays at least one indoor game chess, carrom and scrabble. 18
play chess, 20 play scrabble and 27 play carrom. 7 play chess and scrabble, 12 play scrabble and
carrom and 4 play chess, carrom and scrabble. Find the number of students who play (i) chess
and carrom. (ii) chess, carrom but not scrabble.
Solution:
We have
Therefore, 40 = 18 + 20 + 27 - 7 - 12 - n(C ∩ A) + 4
40 = 69 – 19 - n(C ∩ A)
40 = 50 - n(C ∩ A) n(C ∩ A) = 50 - 40
n(C ∩ A) = 10
10
Therefore, Number of students who play chess and carrom are 10.
Also, number of students who play chess, carrom and not scrabble.
= n(C ∩ A) - n(A ∩ B ∩ C)
= 10 – 4
=6
Therefore, we learned how to solve different types of word problems on sets without using Venn
diagram.
Set theory has its own notations and symbols that can seem unusual for many. In this tutorial, we
look at some solved examples to understand how set theory works and the kind of problems it
can be used to solve.
Definition
For example:
Set of natural numbers = {1,2,3,…..}
Set of whole numbers = {0,1,2,3,…..}
The set that contains all the elements of a given collection is called the universal set and is
represented by the symbol ‘µ’, pronounced as ‘mu’.
11
Consider the following example:
Question: In a class of 100 students, 35 like science and 45 like math. 10 like both. How many
like either of them and how many like neither?
Solution:
→ 45+35-10 = 70
The easiest way to solve problems on sets is by drawing Venn diagrams, as shown below.
As it is said, one picture is worth a thousand words. One Venn diagram can help solve the
problem faster and save time. This is especially true when more than two categories are involved
in the problem.
Solution:
Every student is learning at least one language. Hence there is no one who fall in the category
‘neither’.
It is mentioned in the problem that a total of 18 are learning English. This DOES NOT mean that
18 are learning ONLY English. Only when the word ‘only’ is mentioned in the problem should
we consider it so.
Now, 18 are learning English and 8 are learning both. This means that 18 – 8 = 10 are learning
ONLY English.
30 = 18+ n(F) – 8
n(F) = 20
Problem 2: Among a group of students, 50 played cricket, 50 played hockey and 40 played
volley ball. 15 played both cricket and hockey, 20 played both hockey and volley ball, 15 played
cricket and volley ball and 10 played all three. If every student played at least one game, find the
number of students and how many played only cricket, only hockey and only volley ball?
Solution:
n(C∩H) = 15
n(H∩V) = 20
n(C∩V) = 15
n(C∩H∩V) = 10
= 50 + 50 + 40 – 15 – 20 – 15 + 10
14
Let a denote the number of people who played cricket and volleyball only.
Let b denote the number of people who played cricket and hockey only.
Let c denote the number of people who played hockey and volleyball only.
Let d denote the number of people who played all three games.
Accordingly, d = n (CnHnV) = 10
Now, n(CnV) = a + d = 15
n(CnH) = b + d = 15
n(HnV) = c + d = 20
No. of students who played only volley ball = n(V) – [a + c + d] = 40 – (10 + 5 + 10) = 15
15
The Venn diagram for the given information looks like this.
Subtracting the values in the intersections from the individual values gives us the number of
students who played only one game.
Question 2
Can anyone help me and solve this question. In a bank of 320 staffs, 120 speak French, 140
speak English, 170 speak Arabic, 50 speak both French and English, 35 speak both English and
Arabic, 40 speak both French and Arabic. Required ;
(a) Determine the number of staffs who speak all the three
n(U) = 320, //n(F)= 120, n(E)= 140, n(A)= 170,// n(F n E)= 50, n(E n A)= 35, n(F n A)= 40// n(F
n E n A)=?.// So let n(F n E n A)= X.
THE FORMULA STATED THAT
n(U) = n(F) + n(E) + n(A) – n(F n E) – n(F n A) – n(E n A) + n(F n E n A) where n(F n E n A) is
X
320 = 120 + 140 + 170 – 50 -35 + 40 + X
320 = 430 – 125 + X
320 =305 + X
320 – 305 =X
16
15 = X
X = 15, Where X is the number of staffs who spokes all the three languages.
So the number of staffs who spokes all the three subject are 15.
2.
.If A = {X:X is a prime number between 4 and 16} list the subset with exactly two elements
here we have A be set of prime numbers between 4 and 16 so the set be X = {5,7,11,13}
SUBSETS with exactly two elements in above set X = {5,7},{5,11},{5,13},{7,11},{7,13},
{11,13}
Data given
Total no of staffs=320
Let F be number of staffs who speak French , E for English And A for Arabic
n(F)=120
n(E)=140
n(A)=170
n(FnE)=50
n(EnA)=35
n(FnA)=40
n(FnEnA)=?
From
n(FuEuA)=n(F)+n(E)+n(A)_n(FnE)_n(EnA)_n(AnF)+n(FnEnA)
320=120+140+170_50_35_40+n(FnEnA)
320=430_125
320_305=15
So
n(FnEnA)=15
So number of staffs who speak both languages are 15 staffs
Out of 45 students questioned, 42 like mathematics or english or both, 27 students like maths and
22 like english.
1) who didn’t like any of the subjects
2)who like maths only
3)both maths and english
HERE
we have the total number of students questioned (U)=45
17
the number of students like either mathematics or english n(MuE)=42
the no. of students like mathematics n(M)=27
the no.of students like english n(E)=22
. PROBABILITY
Meaning and definition of Probability
As the Oxford dictionary states it, Probability means ‘The extent to which something is probable;
the likelihood of something happening or being the case’.
In mathematics too, probability indicates the same – the likelihood of the occurrence of an event.
Probability classification
Compound probability
18
Compound probability is when the problem statement asks for the likelihood of the occurrence of
more than one outcome.
P(A and B) is the probability of the occurrence of both A and B at the same time.
Mutually exclusive events are those where the occurrence of one indicates the non-occurrence of
the other
OR
When two events cannot occur at the same time, they are considered mutually exclusive.
Solution:
Taking the individual probabilities of each number, getting a 2 is 1/6 and so is getting a 5.
Probability of getting a 2 or a 5,
19
Example 2: Consider the example of finding the probability of selecting a black card or a 6 from
a deck of 52 cards.
Solution:
= 28/52
= 7/13.
Independent Event
When multiple events occur, if the outcome of one event DOES NOT affect the outcome of the
other events, they are called independent events.
Say, a die is rolled twice. The outcome of the first roll doesn’t affect the second outcome. These
two are independent events.
Example 1: Say, a coin is tossed twice. What is the probability of getting two consecutive tails ?
Here’s the verification of the above answer with the help of sample space.
20
When a coin is tossed twice, the sample space is {(H,H), (H,T), (T,H), (T,T)}.
Our desired event is (T,T) whose occurrence is only once out of four possible outcomes and
hence, our answer is 1/4.
Example 2: Consider another example where a pack contains 4 blue, 2 red and 3 black pens. If a
pen is drawn at random from the pack, replaced and the process repeated 2 more times, What is
the probability of drawing 2 blue pens and 1 black pen?
Solution
Dependent Events
When two events occur, if the outcome of one event affects the outcome of the other, they are
called dependent events.
Consider the aforementioned example of drawing a pen from a pack, with a slight difference.
Example 1: A pack contains 4 blue, 2 red and 3 black pens. If 2 pens are drawn at random from
the pack, NOT replaced and then another pen is drawn. What is the probability of drawing 2 blue
pens and 1 black pen?
Solution:
Example 2: What is the probability of drawing a king and a queen consecutively from a deck of
52 cards, without replacement.
21
Probability of drawing a king = 4/52 = 1/13
Now, the probability of drawing a king and queen consecutively is 1/13 * 4/51 = 4/663
Conditional probability
Conditional probability is calculating the probability of an event given that another event has
already occured .
Example: In a class, 40% of the students study math and science. 60% of the students study
math. What is the probability of a student studying science given he/she is already studying
math?
Solution
P(M) = 0.60
Complement of an event
A complement of an event A can be stated as that which does NOT contain the occurrence of A.
P(Ac) = 1 – P(A)
22
or it can be stated, P(A)+P(Ac) = 1
For example,
if A is the event of getting a head in coin toss, Ac is not getting a head i.e., getting a tail.
if A is the event of getting an even number in a die roll, Ac is the event of NOT getting an even
number i.e., getting an odd number.
Example: A single coin is tossed 5 times. What is the probability of getting at least one head?
Solution:
Probability Example 1
What is the probability of the occurrence of a number that is odd or less than 5 when a fair die is
rolled.
Solution
Let the event of the occurrence of a number that is odd be ‘A’ and the event of the occurrence of
a number that is less than 5 be ‘B’. We need to find P(A or B).
23
P(A and B) = 2/6 (numbers that are both odd and less than 5 = 1 and 3)
P(A or B) = 5/6.
Probability Example 2
A box contains 4 chocobars and 4 ice creams. Tom eats 3 of them one after another. What is the
probability of sequentially choosing 2 chocobars and 1 icecream?
Solution
So the final probability of choosing 2 chocobars and 1 icecream = 1/2 * 3/7 * 2/3 = 1/7
Probability Example 3
When two dice are rolled, find the probability of getting a greater number on the first die than the
one on the second, given that the sum should equal 8.
Solution
There are 5 ways to get a sum of 8 when two dice are rolled = {(2,6),(3,5),(4,4), (5,3),(6,2)}.
And there are two ways where the number on the first die is greater than the one on the second
given that the sum should equal 8, G = {(5,3), (6,2)}.
24
Therefore, P(Sum equals 8) = 5/36 and P(G) = 2/36.
= (2/36)/(5/36)
= 2/5
PROBABILITY RULES
There are three main rules associated with basic probability: the addition rule, the multiplication
rule, and the complement rule. You can think of the complement rule as the 'subtraction rule' if it
helps you to remember it.
25
1.) The Addition Rule: P(A or B) = P(A) + P(B) - P(A and B)
If A and B are mutually exclusive events, or those that cannot occur together, then the third
term is 0, and the rule reduces to P(A or B) = P(A) + P(B). For example, you can't flip a coin and
have it come up both heads and tails on one toss.
2.) The Multiplication Rule: P(A and B) = P(A) * P(B|A) or P(B) * P(A|B)
If A and B are independent events, we can reduce the formula to P(A and B) = P(A) * P(B).
The term independent refers to any event whose outcome is not affected by the outcome of
another event. For instance, consider the second of two coin flips, which still has a .50 (50%)
probability of landing heads, regardless of what came up on the first flip. What is the probability
that, during the two coin flips, you come up with tails on the first flip and heads on the second
flip?
Do you see why the complement rule can also be thought of as the subtraction rule? This rule
builds upon the mutually exclusive nature of P(A) and P(not A). These two events can never
occur together, but one of them always has to occur. Therefore P(A) + P(not A) = 1. For
example, if the weatherman says there is a 0.3 chance of rain tomorrow, what are the chances of
no rain?
For example, what is the probability of a person's favorite color being blue if you know the
following:
26
Left-handed people have blue as a favorite color 30% of the time
Right-handed people like blue 40% of the time
Left-handed people make up 10% of the population
1.) P(Blue) = P(left handed) * P(like blue|left handed) + P(not left handed) * (P(like blue|not
left handed)
Terms in Probability
The following terms in probability help in a better understanding of the concepts of probability.
We can construct a probability tree diagram to help us solve some probability problems.
A probability tree diagram shows all the possible events. The first event is represented by a
dot. From the dot, branches are drawn to represent all possible outcomes of the event. The
probability of each outcome is written on its branch.
Example:
A bag contains 3 black balls and 5 white balls. Paul picks a ball at random from the bag and
replaces it back in the bag. He mixes the balls in the bag and then picks another ball at random
from the bag.
a) Construct a probability tree of the problem.
b) Calculate the probability that Paul picks:
i) two black balls
ii) a black ball in his second draw
Solution:
28
b) i) To find the probability of getting two black balls, first locate the B branch and then follow
the second B branch. Since these are independent events we can multiply the probability of each
branch.
ii) There are two outcomes where the second ball can be black, either (B, B) or (W, B)
29
= P(B, B) + P(W, B)
Example:
Bag A contains 10 marbles of which 2 are red and 8 are black. Bag B contains 12 marbles of
which 4 are red and 8 are black. A ball is drawn at random from each bag.
a) Draw a probability tree diagram to show all the outcomes the experiment.
b) Find the probability that:
(i) both are red.
(ii) both are black.
(iii) one black and one red.
(iv) at least one red.
Solution:
a) A probability tree diagram that shows all the outcomes of the experiment.
P(R, R) =
30
(ii) both are black.
P(B, B) =
P(R, B) or P(B, R) =
1 - P(B, B) =
Example:
A box contains 4 red and 2 blue chips. A chip is drawn at random and then replaced. A second
chip is then drawn at random.
a) Show all the possible outcomes using a probability tree diagram.
b) Calculate the probability of getting:
(i) at least one blue.
(ii) one red and one blue.
(iii) two of the same color.
Solution:
a) A probability tree diagram to show all the possible outcomes.
31
b) The probability of getting:
(i) at least one blue.
P(R, B) or P(B, R) =
P(R, R) or P(B, B) =
How To Use A Probability Tree Diagram To Calculate Probabilities Of Two Events Which
Are Not Independent?
Example:
Jimmy has a bag with seven blue sweets and 3 red sweets in it. He picks up a sweet at random
32
from the bag, but does not replaces it and then picks again at random. Draw a tree diagram to
represent this situation and use it to calculate the probabilities that he picks:
(a) two red sweets
(b) no red sweets
(c) at least one blue sweet
(d) one sweet of each color
Binomial expansion
The binomial is a type of distribution that has two possible outcomes (the prefix “bi” means two,
or twice). ... The first variable in the binomial formula, n, stands for the number of times the
experiment runs. The second variable, p, represents the probability of one specific outcome.
Binomial distributions are the results from experiments with two outcomes. The term
“experiment” can mean a trial, a decision, or just a roll of the die. They are really just a measure
of success (or failure). In other words, something happens, or it doesn’t. Will I live to 100, or
won’t I? Will my car start, or won’t it? Can I pay my college tuition or not?
33
Measures of Central Tendency
Measures of Central Tendency
Generally, the central tendency of a dataset can be described using the following measures:
Mean (Average): Represents the sum of all values in a dataset divided by the total
number of the values.
Median: The middle value in a dataset that is arranged in ascending order (from the
smallest value to the largest value). If a dataset contains an even number of values, the
median of the dataset is the mean of the two middle values.
Mode: Defines the most frequently occurring value in a dataset. In some cases, a dataset
may contain multiple modes, while some datasets may not have any mode at all.
Mean (Arithmetic)
The mean (or average) is the most popular and well known measure of central tendency. It can
be used with both discrete and continuous data, although its use is most often with continuous
data (see our Types of Variable guide for data types). The mean is equal to the sum of all the
values in the data set divided by the number of values in the data set. So, if we have
values in a data set and they have values …, the sample mean, usually denoted by
This formula is usually written in a slightly different manner using the Greek capitol letter,
You may have noticed that the above formula refers to the sample mean. So, why have we called
it a sample mean? This is because, in statistics, samples and populations have very different
meanings and these differences are very important, even if, in the case of the mean, they are
calculated in the same way. To acknowledge that we are calculating the population mean and not
the sample mean, we use the Greek lower case letter "mu", denoted as
The mean is essentially a model of your data set. It is the value that is most common. You will
notice, however, that the mean is not often one of the actual values that you have observed in
your data set. However, one of its important properties is that it minimises error in the prediction
of any one value in your data set. That is, it is the value that produces the lowest amount of error
from all other values in the data set.
34
An important property of the mean is that it includes every value in your data set as part of the
calculation. In addition, the mean is the only measure of central tendency where the sum of the
deviations of each value from the mean is always zero.
The mean has one main disadvantage: it is particularly susceptible to the influence of outliers.
These are values that are unusual compared to the rest of the data set by being especially small or
large in numerical value. For example, consider the wages of staff at a factory below:
Staff 1 2 3 4 5 6 7 8 9 10
Salary 15k 18k 16k 14k 15k 15k 12k 17k 90k 95k
The mean salary for these ten staff is $30.7k. However, inspecting the raw data suggests that this
mean value might not be the best way to accurately reflect the typical salary of a worker, as most
workers have salaries in the $12k to 18k range. The mean is being skewed by the two large
salaries. Therefore, in this situation, we would like to have a better measure of central tendency.
As we will find out later, taking the median would be a better measure of central tendency in this
situation.
Another time when we usually prefer the median over the mean (or mode) is when our data is
skewed (i.e., the frequency distribution for our data is skewed). If we consider the normal
distribution - as this is the most frequently assessed in statistics - when the data is perfectly
normal, the mean, median and mode are identical. Moreover, they all represent the most typical
value in the data set. However, as the data becomes skewed the mean loses its ability to provide
the best central location for the data because the skewed data is dragging it away from the typical
value. However, the median best retains this position and is not as strongly influenced by the
skewed values. This is explained in more detail in the skewed distribution section later in this
guide.
While calculating the mean of the grouped data, the values x1, x2, x3, ……. xn are taken as the
mid-values or the class marks of various class intervals. If the frequency distribution is inclusive,
then it should be first converted to exclusive distribution.
35
Find the mean number of plans per house
Solution:
We have
∑fi = 1 + 2 + 2 + 4 + 6 + 2 + 3 = 20
∑fi xi =1 + 6 + 10 + 28 + 54 + 22 + 39 = 160
Median
The median is the middle score for a set of data that has been arranged in order of magnitude.
The median is less affected by outliers and skewed data. In order to calculate the median,
suppose we have the data below:
65 55 89 56 35 14 56 55 87 45 92
We first need to rearrange that data into order of magnitude (smallest first):
14 35 45 55 55 56 56 65 87 89 92
Our median mark is the middle mark - in this case, 56 (highlighted in bold). It is the middle mark
because there are 5 scores before it and 5 scores after it. This works fine when you have an odd
number of scores, but what happens when you have an even number of scores? What if you had
36
only 10 scores? Well, you simply have to take the middle two scores and average the result. So,
if we look at the example below:
65 55 89 56 35 14 56 55 87 45
14 35 45 55 55 56 56 65 87 89
Only now we have to take the 5th and 6th score in our data set and average them to get a median
of 55.5.
Mode
The mode is the most frequent score in our data set. On a histogram it represents the highest bar
in a bar chart or histogram. You can, therefore, sometimes consider the mode as being the most
popular option. An example of a mode is presented below:
37
Mean of Grouped Data
Mean of grouped data is the data set formed by aggregating individual observations of a variable
into different groups. Grouped data is data that is grouped together in different categories. Mean
is considered as the average of the data. For the mean of grouped data, it might be difficult to
find the exact value however, we can always estimate it. Let us learn more about the mean of
grouped data, the methods to find the mean of grouped data, and solve a few examples to
understand this concept better.
38
What is Mean of Grouped Data?
Mean of grouped data is the process of finding the average of a set of data that are grouped
together in different categories. To determine the mean of a grouped data, a frequency table is
required to set across the frequencies of the data which makes it simple to calculate. There are
three main methods of calculating the mean of grouped data, they are - direct method, assumed
mean method, and step deviation method. Each of these methods has its own formulas and ways
to calculate the mean.
Definition of Mean
The mean is the average or a calculated central value of a set of numbers that is used to measure
the central tendency of the data. Central tendency is the statistical measure that recognizes the
entire set of data or distribution through a single value. In statistics, the mean can also be defined
as the sum of all observations to the total number of observations. Given a data set,
X=x1,x2,...,xn
, the mean (or arithmetic mean, or average), denoted x̄ , is the mean of the n values x1,x2,...,xn
The mean formula is defined as the sum of the observations divided by the total number of
observations. There are two different formulas for calculating the mean for ungrouped data and the
mean for grouped data. Let us look at the formula to calculate the mean of grouped data. The formula
is: x̄ = Σfi/N
Where,
N = sum of frequencies
Direct Method
The direct method is the simplest method to find the mean of the grouped data. If the values of
the observations are x1
, x2, x3,.....xn with their corresponding frequencies are f1, f2, f3,.....fn
x̄ = x1
x̄ = ∑xi
fi / ∑fi
, where i = 1, 2, 3, 4,......n
Here are the steps that can be followed to find the mean for grouped data using the direct
method,
Create a table containing four columns such as class interval, class marks (corresponding),
denoted by xi frequencies fi (corresponding), and xifi
Calculate Mean by the Formula Mean = ∑xifi / ∑fi. Where fi is the frequency and xi
is the midpoint of the class interval.
Calculate the midpoint, xi, we use this formula xi = (upper class limit + lower class limit)/2.
Class Interval 0 - 10 10 - 20 20 - 30 30 - 40 40 - 50
Frequency (fi 9 13 8 15 10
40
Solution: The first step is to create the table with the midpoint or marks and the product of the
frequency and midpoint. To calculate the midpoint we find the average between the class interval
by using the formula mentioned above.
Midpoint xi
xifi = For the class interval 0 - 10 = 5 × 9 = 45, For the class interval 10 - 20 = 13 × 15 = 195 and
so on.
Question 1
The following data represent the annual rainfall distribution in St. Louis, Missouri, for a sample
of 25 years from 1870 to 2004.
Rainfall (inches) Number of Years
20 - 24 1
25 - 29 3
30 - 34 5
35 - 39 8
40 - 44 5
45 - 49 2
50 - 54 0
55 - 59 1
Required
The following data show the various runners and the time they take to complete a race.
Seconds Frequency
51 – 55 2
56 – 60 7
41
61 – 65 8
66 – 70 4
The groups (51-55, 56-60, etc), also called class intervals, are of width 5
The midpoints are in the middle of each class: 53, 58, 63 and 68
53 2 106
58 7 406
63 8 504
68 4 272
Totals: 21 1288
And then our estimate of the mean time to complete the race is:
Seconds Frequency
51 - 55 2
56 - 60 7
61 - 65 8
66 - 70 4
Median formular N+1/2
The median is the middle value, which in our case is the 11th one, which is in the 61 - 65 group:
42
Estimated Median = L + (n/2)/G − B × w
where:
Seconds Frequency
51 - 55 2
56 - 60 7
61 - 65 8
66 - 70 4
We can easily find the modal group (the group with the highest frequency), which is 61 - 65
But the actual Mode may not even be in that group! Or there may be more than one mode.
Without the raw data we don't really know.
where:
43
fm+1 is the frequency of the group after the modal group
In this example:
L = 60.5
fm-1 = 7
fm = 8
fm+1 = 4
w=5
= 60.5 + (1/5) × 5
= 61.5
LINEAR PROGRAMMING
Applications of linear programming are everywhere around you. You use linear programming at
personal and professional fronts. You are using linear programming when you are driving from
home to work and want to take the shortest route. Or when you have a project delivery you make
strategies to make your team work efficiently for on-time delivery.
Let’s say a FedEx delivery man has 6 packages to deliver in a day. The warehouse is located at
point A. The 6 delivery destinations are given by U, V, W, X, Y, and Z. The numbers on the
lines indicate the distance between the cities. To save on fuel and time the delivery person wants
to take the shortest route.
45
So, the delivery person will calculate different routes for going to all the 6 destinations and then
come up with the shortest route. This technique of choosing the shortest route is called linear
programming.
Operation Research
the objective of the delivery person is to deliver the parcel on time at all 6 destinations. The
process of choosing the best route is called Operation Research. Operation research is an
approach to decision-making, which involves a set of methods to operate a system. In the above
example, my system was the Delivery model.
Linear programming is used for obtaining the most optimal solution for a problem with given
constraints. In linear programming, we formulate our real-life problem into a mathematical
model. It involves an objective function, linear inequalities with subject to constraints.
Is the linear representation of the 6 points above representative of the real-world? Yes and No. It
is an oversimplification as the real route would not be a straight line. It would likely have
multiple turns, U-turns, signals and traffic jams. But with a simple assumption, we have reduced
the complexity of the problem drastically and are creating a solution that should work in most
scenarios.
Example: Consider a chocolate manufacturing company that produces only two types of
chocolate – A and B. Both the chocolates require Milk and Choco only. To manufacture each
unit of A and B, the following quantities are required:
The company kitchen has a total of 5 units of Milk and 12 units of Choco. On each sale, the
company makes a profit of
46
Rs 5 per unit B sold.
Now, the company wishes to maximize its profit. How many units of A and B should it produce
respectively?
Solution: The first thing I’m gonna do is represent the problem in a tabular form for better
understanding.
A 1 3 Rs 6
B 1 2 Rs 5
Total 5 12
The total profit the company makes is given by the total number of units of A and B produced
multiplied by its per-unit profit of Rs 6 and Rs 5 respectively.
The company will try to produce as many units of A and B to maximize the profit. But the
resources Milk and Choco are available in a limited amount.
As per the above table, each unit of A and B requires 1 unit of Milk. The total amount of Milk
available is 5 units. To represent this mathematically,
X+Y ≤ 5
47
Also, each unit of A and B requires 3 units & 2 units of Choco respectively. The total amount of
Choco available is 12 units. To represent this mathematically,
3X+2Y ≤ 12
For the company to make maximum profit, the above inequalities have to be satisfied.
Let us define some terminologies used in Linear Programming using the above example.
Decision Variables: The decision variables are the variables that will decide my output.
They represent my ultimate solution. To solve any problem, we first need to identify the
decision variables. For the above example, the total number of units for A and B denoted
by X & Y respectively are my decision variables.
Constraints: The constraints are the restrictions or limitations on the decision variables.
They usually limit the value of the decision variables. In the above example, the limit on
the availability of resources Milk and Choco are my constraints.
Non-negativity restriction: For all linear programs, the decision variables should always
take non-negative values. This means the values for decision variables should be greater
than or equal to 0.
48
1. Identify the decision variables
For a problem to be a linear programming problem, the decision variables, objective function and
constraints all have to be linear functions.
If all the three conditions are satisfied, it is called a Linear Programming Problem.
A linear program can be solved by multiple methods. In this section, we are going to look at the
Graphical method for solving a linear program. This method is used to solve a two-variable
linear program. If you have only two decision variables, you should use the graphical method to
find the optimal solution.
A graphical method involves formulating a set of linear inequalities subject to the constraints.
Then the inequalities are plotted on an X-Y plane. Once we have plotted all the inequalities on a
graph the intersecting region gives us a feasible region. The feasible region explains what all
values our model can take. And it also gives us the optimal solution.
Example: A farmer has recently acquired a 110 hectares piece of land. He has decided to grow
Wheat and barley on that land. Due to the quality of the sun and the region’s excellent climate,
the entire production of Wheat and Barley can be sold. He wants to know how to plant each
variety in the 110 hectares, given the costs, net profits and labor requirements according to the
data shown below:
Wheat 100 50 10
49
Barley 200 120 30
The farmer has a budget of US$10,000 and availability of 1,200 man-days during the planning
horizon. Find the optimal solution and the optimal value.
Solution: To solve this problem, first we gonna formulate our linear program.
Since the production from the entire land can be sold in the market. The farmer would want to
maximize the profit for his total produce. We are given net profit for both Wheat and Barley. The
farmer earns a net profit of US$50 for each hectare of Wheat and US$120 for each Barley.
1. It is given that the farmer has a total budget of US$10,000. The cost of producing Wheat and
Barley per hectare is also given to us. We have an upper cap on the total cost spent by the farmer.
So our equation becomes:
2. The next constraint is the upper cap on the availability of the total number of man-days for the
planning horizon. The total number of man-days available is 1200. As per the table, we are given
the man-days per hectare for Wheat and Barley.
50
3. The third constraint is the total area present for plantation. The total available area is 110
hectares. So the equation becomes,
X + Y ≤ 110
The values of X and Y will be greater than or equal to 0. This goes without saying.
X ≥ 0, Y ≥ 0
To plot for the graph for the above equations, first I will simplify all the equations.
Plot the first 2 lines on a graph in the first quadrant (like shown below)
The optimal feasible solution is achieved at the point of intersection where the budget & man-
days constraints are active. This means the point at which the equations X + 2Y ≤ 100 and X +
3Y ≤ 120 intersect gives us the optimal solution.
The values for X and Y which gives the optimal solution is at (60,20).
To maximize profit the farmer should produce Wheat and Barley in 60 hectares and 20 hectares
of land respectively.
= US$5400
51
52
THE SIMPLEX METHOD
1. Set up the problem. That is, write the objective function and the inequality constraints.
2. Convert the inequalities into equations. This is done by adding one slack variable for
each inequality.
3. Construct the initial simplex tableau. Write the objective function as the bottom row.
4. The most negative entry in the bottom row identifies the pivot column.
5. Calculate the quotients. The smallest quotient identifies a row. The element in the
intersection of the column identified in step 4 and the row identified in this step is
identified as the pivot element. The quotients are computed by dividing the far right
column by the identified column in step 4. A quotient that is a zero, or a negative number,
or that has a zero in the denominator, is ignored.
6. Perform pivoting to make all other entries in this column zero. This is done the same
way as we did with the Gauss-Jordan method.
7. When there are no more negative entries in the bottom row, we are finished;
otherwise, we start again from step 4.
8. Read off your answers. Get the variables using the columns with 1 and 0s. All other
variables are zero. The maximum value you are looking for appears in the bottom right
hand corner.
Now, we use the simplex method to solve Example 3.1.1 solved geometrically in section 3.1.
Example 4.2.1
Niki holds two part-time jobs, Job I and Job II. She never wants to work more than a total of 12
hours a week. She has determined that for every hour she works at Job I, she needs 2 hours of
preparation time, and for every hour she works at Job II, she needs one hour of preparation time,
and she cannot spend more than 16 hours for preparation. If she makes $40 an hour at Job I, and
$30 an hour at Job II, how many hours should she work per week at each job to maximize her
income?
Solution
In solving this problem, we will follow the algorithm listed above.
STEP 1. Set up the problem. Write the objective function and the constraints.
Since the simplex method is used for problems that consist of many variables, it is not practical
to use the variables x, y, z etc. We use symbols x1, x2, x3
, and so on.
53
Let
x1 = The number of hours per week Niki will work at Job I and
x2= The number of hours per week Niki will work at Job II.
It is customary to choose the variable that is to be maximized as Z
The problem is formulated the same way as we did in the last chapter.
Maximize Subject to: Z=40x1+30x2x1+x2≤122x1+x2≤16x1≥0;x2≥0
STEP 2. Convert the inequalities into equations. This is done by adding one slack variable for
each inequality.
For example to convert the inequality x1+x2≤12
into an equation, we add a non-negative variable y1
, and we get
x1+x2+y1=12
Here the variable y1 picks up the slack, and it represents the amount by which x1+x2 falls short
of 12. In this problem, if Niki works fewer than 12 hours, say 10, then y1 is 2. Later when we
read off the final solution from the simplex table, the values of the slack variables will identify
the unused amounts.
We rewrite the objective function Z=40x1+30x2
as −40x1−30x2+Z=0
.
After adding the slack variables, our problem reads
Objectivefunction Subject to
constraints: −40x1−30x2+Z=0x1+x2+y1=122x1+x2+y2=16x1≥0;x2≥0
STEP 3. Construct the initial simplex tableau. Each inequality constraint appears in its own
row. (The non-negativity constraints do not appear as rows in the simplex tableau.) Write the
objective function as the bottom row.
Now that the inequalities are converted into equations, we can represent the problem into an
augmented matrix called the initial simplex tableau as follows.
54
Here the vertical line separates the left hand side of the equations from the right side. The
horizontal line separates the constraints from the objective function. The right side of the
equation is represented by the column C.
The reader needs to observe that the last four columns of this matrix look like the final matrix for
the solution of a system of equations. If we arbitrarily choose x1=0
and x2=0
, we get
y1100y2010Z001
which reads
y1=12y2=16Z=0
The solution obtained by arbitrarily assigning values to some variables and then solving for the
remaining variables is called the basic solution associated with the tableau. So the above
solution is the basic solution associated with the initial simplex tableau. We can label the basic
solution variable in the right of the last column as shown in the table below.
STEP 4. The most negative entry in the bottom row identifies the pivot column.
The most negative entry in the bottom row is -40; therefore the column 1 is identified.
Question Why do we choose the most negative entry in the bottom row?
55
Answer The most negative entry in the bottom row represents the largest coefficient in the
objective function - the coefficient whose entry will increase the value of the objective function
the quickest.
The simplex method begins at a corner point where all the main variables, the variables that have
symbols such as x1
, x2, x3 etc., are zero. It then moves from a corner point to the adjacent corner point always
increasing the value of the objective function. In the case of the objective function Z=40x1+30x2,
it will make more sense to increase the value of x1 rather than x2. The variable x1 represents the
number of hours per week Niki works at Job I. Since Job I pays $40 per hour as opposed to Job
II which pays only $30, the variable x1 will increase the objective function by $40 for a unit of
increase in the variable x1
.
STEP 5. Calculate the quotients. The smallest quotient identifies a row. The element in the
intersection of the column identified in step 4 and the row identified in this step is identified
as the pivot element.
Following the algorithm, in order to calculate the quotient, we divide the entries in the far right
column by the entries in column 1, excluding the entry in the bottom row.
The smallest of the two quotients, 12 and 8, is 8. Therefore row 2 is identified. The intersection
of column 1 and row 2 is the entry 2, which has been highlighted. This is our pivot element.
Question Why do we find quotients, and why does the smallest quotient identify a row?
Answer When we choose the most negative entry in the bottom row, we are trying to increase the
value of the objective function by bringing in the variable x1
. But we cannot choose any value for x1. Can we let x1=100? Definitely not! That is because
Niki never wants to work for more than 12 hours at both jobs combined: x1+x2≤12. Can we let
x1=12
? Again, the answer is no because the preparation time for Job I is two times the time spent on
the job. Since Niki never wants to spend more than 16 hours for preparation, the maximum time
she can work is 16 ÷ 2 = 8.
56
Now you see the purpose of computing the quotients; using the quotients to identify the pivot
element guarantees that we do not violate the constraints.
Question Why do we identify the pivot element?
Answer As we have mentioned earlier, the simplex method begins with a corner point and then
moves to the next corner point always improving the value of the objective function. The value
of the objective function is improved by changing the number of units of the variables. We may
add the number of units of one variable, while throwing away the units of another. Pivoting
allows us to do just that.
The variable whose units are being added is called the entering variable, and the variable whose
units are being replaced is called the departing variable. The entering variable in the above
table is x1
, and it was identified by the most negative entry in the bottom row. The departing variable y2
was identified by the lowest of all quotients.
STEP 6. Perform pivoting to make all other entries in this column zero.
In chapter 2, we used pivoting to obtain the row echelon form of an augmented matrix. Pivoting
is a process of obtaining a 1 in the location of the pivot element, and then making all other
entries zeros in that column. So now our job is to make our pivot element a 1 by dividing the
entire second row by 2. The result follows.
To obtain a zero in the entry first above the pivot element, we multiply the second row by -1 and
add it to row 1. We get
To obtain a zero in the element below the pivot, we multiply the second row by 40 and add it to
the last row.
57
We now determine the basic solution associated with this tableau. By arbitrarily choosing x2=0
and y2=0, we obtain x1=8, y1=4, and z=320
. If we write the augmented matrix, whose left side is a matrix with columns that have one 1 and
all other entries zeros, we get the following matrix stating the same thing.
⎡⎣⎢⎢⎢⎢x1010y1100Z001||||C48320⎤⎦⎥⎥⎥⎥
We can restate the solution associated with this matrix as x1=8
, x2=0, y1=4, y2=0 and z=320. At this stage of the game, it reads that if Niki works 8 hours at Job
I, and no hours at Job II, her profit Z will be $320. Recall from Example 3.1.1 in section 3.1 that
(8, 0) was one of our corner points. Here y1=4 and y2=0
mean that she will be left with 4 hours of working time and no preparation time.
STEP 7. When there are no more negative entries in the bottom row, we are finished;
otherwise, we start again from step 4.
Since there is still a negative entry, -10, in the bottom row, we need to begin, again, from step 4.
This time we will not repeat the details of every step, instead, we will identify the column and
row that give us the pivot element, and highlight the pivot element. The result is as follows.
Now to make all other entries as zeros in this column, we first multiply row 1 by -1/2 and add it
to row 2, and then multiply row 1 by 10 and add it to the bottom row.
58
We no longer have negative entries in the bottom row, therefore we are finished.
Question Why are we finished when there are no negative entries in the bottom row?
Answer The answer lies in the bottom row. The bottom row corresponds to the equation:
0x1+0x2+20y1+10y2+Z=400 or z=400−20y1−10y2
Since all variables are non-negative, the highest value Z
can ever achieve is 400, and that will happen only when y1 and y2
are zero.
STEP 8. Read off your answers.
We now read off our answers, that is, we determine the basic solution associated with the final
simplex tableau. Again, we look at the columns that have a 1 and all other entries zeros. Since
the columns labeled y1
and y2 are not such columns, we arbitrarily choose y1=0, and y2=0
, and we get
⎡⎣⎢⎢⎢⎢x1010x2100Z001||||C84400⎤⎦⎥⎥⎥⎥
The matrix reads x1=4
, x2=8 and z=400
.
The final solution says that if Niki works 4 hours at Job I and 8 hours at Job II, she will
maximize her income to $400. Since both slack variables are zero, it means that she would have
used up all the working time, as well as the preparation time, and none will be left.
59
What Is Utility Function?
In economics, utility represents the satisfaction or pleasure that consumers receive for consuming
a good or service. Utility function measures consumers' preferences for a set of goods and
services.
Utility is measured in units called utils—the Spanish word for useful— but calculating the
benefit or satisfaction that consumers receive is abstract and difficult to pinpoint. As a result,
economists measure utility in terms of revealed preferences by observing consumers' choices.
From there, economists create an ordering of consumption baskets from least desired to the most
preferred.
Key points
In economics, utility function is an important concept that measures preferences over a
set of goods and services.
Utility represents the satisfaction that consumers receive for choosing and consuming a
product or service.
Economists track consumer choices to ascertain one product's utility versus another and
assign a numerical value to that utility.
Company executives research consumers' utility to guide the company's sales and
marketing plans, advertising, and new product offerings.
Ordinal utility ranks choices by preference, whereas cardinal utility measures the utility
received from a choice.
Understanding Utility Function
In economics, the utility function measures the welfare or satisfaction of a consumer as a
function of the consumption of real goods, such as food or clothing. Utility function is widely
used in rational choice theory to analyze human behavior.
When economists measure or rank the preferences of consumers, it is referred to as ordinal
utility. In other words, the order in which consumers choose one product over another can
establish that consumers assign a higher value to the chosen product. Ordinal utility measures
how consumers rank products, but it does not measure how much more one ranks above the
other.
To better understand ordinal utility, consider the following example. Three contestants vie for
first place in a dance competition. Contestant A is declared the winner. Contestant B is the
runner-up, and contestant B ranked third. Ordinal utility reveals that the judges preferred
contestant A over contestants B and C and contestant B over C. What ordinal function does not
tell us is to what degree one was preferred over the other.
60
Mainly used in microeconomics, cardinal utility assigns a numeric value to the consumer's
preference, indicating the degree to which one choice ranks above another. Cardinal utility will
define how much more contestant A was preferred over contestants B and C, and so on.
When considering utility, it is important to understand the concepts of total utility and marginal
utility. Marginal utility measures the satisfaction or benefits a person gets from consuming an
additional unit of a product or service. Total utility measures the satisfaction or benefits a person
gets from the total consumption—including marginal utility—of a product or service.
If consuming 10 units of a product yields 20 utils, and consuming one additional unit yields 1
util, the total utility is 21 utils. If consuming another unit yields .5 utils, the total utility would
then become 21.5 utils.
Economists believe that the amount of satisfaction one receives from each additional unit of
consumption diminishes with each unit consumed. This concept is called the law of diminishing
marginal utility. Diminishing marginal utility doesn't state that consuming additional units will
fail to satisfy the consumer; it states that the satisfaction from consuming more and more units is
less than the first additional units consumed.
How to Calculate a Utility Function
Utility functions are expressed as a function of the quantities of a bundle of goods or services. It
is often denoted as U(X1, X2, X3, Xn).
A utility function that describes a preference for one bundle of goods (X a) vs another bundle of
goods (Xb) is expressed as U(Xa, Xb).
Where there are perfect complements, the utility function is written as U(X a, Xb) = MIN[Xa, Xb],
where the smaller of the two is assigned the function's value.
In certain situations, the goods may be considered perfect substitutes for each other, and the
appropriate utility function must reflect such preferences with a utility form of U(X a, Xb) = Xa+
Xb.1
Example of Utility Function
Let's say a consumer is shopping for a new car and has narrowed the choice down to two cars.
The cars are nearly identical, except the second car has enhanced safety features. As a result, the
second car costs $2,000 more than the first car.
The incremental or marginal utility or satisfaction derived from car two could be represented
numerically as the $2,000 price difference between the two cars. In other words, the consumer is
receiving $2,000 in incremental or marginal utility from car two.
Furthermore, let's say that 100,000 consumers throughout the economy preferred car two to car
one. Economists might infer that consumers, overall, received $200 million (100,000 x $2,000)
worth of incremental utility from the safety features of car two. Utility is derived from the
61
consumer's belief that they are likely to have fewer accidents due to the added safety features of
car two.
Advantages and Disadvantages of Utility Function
Economists can't assign a true numerical value to a consumer's level of satisfaction from a
preference or choice. Also, pinpointing the reason for purchase can be difficult; there are usually
many variables to consider.
In the previous example, the two cars were nearly identical. In reality, there might be several
features or differences between the two cars. As a result, assigning a value to a consumer's
preference can be challenging since one consumer might prefer the safety features while another
might prefer something else.
Tracking and assigning values to utility can still be useful to economists. Over time, choices and
preferences may indicate changes in spending patterns and in utility.
Understanding the logic behind consumer choices and their level of satisfaction is not only
important to economists but to companies, as well. Company executives can use utility to track
how consumers view their products.
Utility function is essentially a "model" used to represent consumer preferences, so companies
often implement them to gain an edge on the competition. For example, studying consumers'
utility can help guide management on anything from marketing and sales to product upgrades
and new offerings.
Utility Function FAQs
What Is Utility Function?
Utility describes the benefits gained or satisfaction experienced with the consumption of goods
or services. Utility function measures the preferences consumers apply to their consumption of
goods and services. For instance, if a customer prefers apples to oranges no matter the amount
consumed, the utility function could be expressed as U(apples) > U(oranges).
What Is the Difference Between Utility Function and Marginal Utility?
Utility function ranks consumers' consumption of goods or services by preference. Marginal
utility measures the change in utility when the rate of consumption changes (i.e., how much more
satisfaction is gained by consuming another unit of a good or service).
Why Is Utility Function Important?
Economists use utility function to better understand consumer behaviors, as well as determine
how well goods and services provide satisfaction to consumers.
62
Utility function can also help analysts determine how to distribute goods and services to
consumers in a way that total utility is realized.
Companies can use utility function to determine which product(s) within their product line (or
that of a competitor) consumers prefer. Knowing these preferences can help management teams
enhance product development to assume a competitive advantage.
The Bottom Line
Utility describes the benefit or satisfaction received from consuming a good or service. The unit
of measurement economists use to gauge satisfaction is called util. Utility function measures
consumers' preferences for bundles of goods or services. Ordinal utility ranks a customer's
choice by preference, and cardinal utility assigns a numeric value to each preference to
determine how much more one good is preferred over another.
63