Or Lecture 202209
Or Lecture 202209
Summary of the common Boolean Logic Gates with symbols and Truth Tables
1
Basic Statistics – Diminishing Uncertainty
1. Collection of Data
When conducting a statistical survey, we are limited in the number of elements which we can
examine. Thus, we should take a sample which should be representative of whatever population is under
consideration. The word ‘population’ in this sense refers to the possible values of the set of variables
being examined (not the number of people).
The sample should be at random so that all members of the population have an equal chance of
being included. Indeed there are tables of random numbers which enable us to:
- Make selections of participants;
- Conduct a survey;
- Eliminate a certain amount of bias.
2. Organizing Data
The first stage in making data usable is to refine it into tabular (table) form – organized in order
and summarized.
In planning to organize the data, we need to bring out the pattern or distribution of the data. In
order to decide on what classes to use we need first to establish the scale of measurement and the range.
The scale may be continuous or discrete.
General rules for forming distributions or frequency distributions are:
- Determine the smallest (minimum) and the largest (maximum) in the raw data and thus find
the range.
- Divide the range into a convenient numbers of class intervals having the same size. If this is
not feasible, use class interval of different size or open class intervals.
- Determine the number of observations falling into each class interval – use a single stroke for
each observation and across-stroke for every fifth one (to make counting easier later). When
added, the total of the strokes in each class is its frequency. This process is known as tally.
2
3.2 Pie graph (Pie charts)
Bar charts are an alternative method of representing data that could be shown on a pictogram or
pie chart, thus they are equally suitable for representing qualitative or quantitative data. The main
difference is the use of “bars” instead of sets of pictures or sectors of a circle.
The bars are equal width, have no significance in this case, so their area are proportional to their
lengths; thus the frequency for each is shown either by height or by area. The vertical scale indicates
frequency and is linear, so equal intervals on the scale stand for equal changes of frequency. The bar
themselves stand on a horizontal axis called baseline or datum with gaps between them, and with data
labels to show what each represents.
3
each class appears on the horizontal scale – so the order of
classes depends on the numerical order of the values. The
width of bars equal to the class interval sizes. The vertical axis
shows the frequency density of each class for areas of bars are
proportional to class frequencies.
A frequency polygon corresponding to the above
frequencies is a line graph of class frequency plotted against
class marks. It is superimposed on the histogram. It can be
obtained by connecting the mid-points of the tops of the bars
(rectangles) of the histogram by a series of straight lines.
4
4.1.1 The Mean of Ungrouped data
For a set of 𝑁 numbers, 𝑥1 , 𝑥2 , …, 𝑥𝑁 , the mean (or arithmetic mean), denoted by 𝑥̅ , is defined
as
𝑥1 + 𝑥2 + … + 𝑥𝑁 ∑𝑁
𝑖=1 𝑥𝑖
𝑥̅ = =
𝑁 𝑁
∑𝑓 ∑ 𝑓𝑑
5
5. Measures of Spread or Dispersion
5.1 The Range
The range is by far the simplest measure of spread.
For a set of numbers of any distribution, the range is the difference between the largest and
smallest data value in the set.
For a frequency table, the range is the difference between the upper boundary of the highest
class and the lower boundary of the lowest class.
6
and their mean. Such a measure of dispersion is the standard deviation, which is obtained by taking the
square root of the variance.
The standard deviation is then the square root of the average (mean) of the squared deviation
from the mean.
For a set of 𝑁 numbers 𝑥1 , 𝑥2 , …, 𝑥𝑁 , whose mean is 𝑥̅ , the standard deviation, denoted by S.D
or σ, is defined as
∑𝑁
𝑖=1(𝑥𝑖 − 𝑥̅ )
2
S.D = σ = √
𝑁
If 𝑥1 , 𝑥2 , …, 𝑥𝑘 , occur with frequencies 𝑓1 , 𝑓2 , …, 𝑓𝑘 respectively, as grouped data, the standard
deviation can be written as
∑𝑘𝑖=1 𝑓𝑖 (𝑥𝑖 − 𝑥̅ )2
S.D = σ = √
𝑁
where N = ∑𝑘𝑖=1 𝑓𝑖
If in a frequency table, the class marks are 𝑥1 , 𝑥2 , …, 𝑥𝑘 , and the respective frequencies are 𝑓1 ,
𝑓2 , …, 𝑓𝑘 , and let 𝑥0 represent a class mark, to be used as assumed mean, then the standard deviation is
defined as
2
∑ 𝑓𝑑 2 ∑ 𝑓𝑑
S.D = √ ( )
∑𝑓 ∑𝑓
∑ 𝑓𝑑′2 ∑ 𝑓𝑑′ 2
S.D = 𝑢 √ ∑𝑓
( ∑𝑓
) .
6. Correlation Analysis
6.1 Introduction
In practice, we may come across with lot of situations which need statistical analysis of either one
or more variables. The data concerned with one variable only is called univariate data. For Example: Price,
income, demand, production, weight, height marks etc are concerned with one variable only. The analysis
of such data is called univariate analysis.
The data concerned with two variables are called bivariate data. For example: rainfall and
agriculture; income and consumption; price and demand; height and weight etc. The analysis of these
two sets of data is called bivariate analysis.
The date concerned with three or more variables are called multivariate date. For example:
agricultural production is influenced by rainfall, quality of soil, fertilizer etc.
6.2 Definition
The statistical technique which can be used to study the relationship between two or more
variables is called correlation analysis.
Two or more variables are said to be correlated if the change in one variable results in a
corresponding change in the other variable.
7
6.3 Methods of measuring correlation
Scatter Diagrams
The kind of distribution which gives this consists of a set of pairs of values called a bivariate
distribution. We can check the relationship between two variables by putting the two variables along the
two axes and plotting points from the table on the same graph. This is called a scatter diagram.
20 20 20
10 10 10
- 20 - 10 0 10 20 - 20 - 10 0 10 20 - 20 - 10 0 10 20
- 10 - 10 - 10
- 20 - 20 - 20
7. Regression Analysis
Correlation analysis analyses whether two variables are correlated or not. After having
established the fact that two variables are closely related, we may be interested in estimating the value
of one variable, given the value of another. Hence, regression analysis means to analyse the average
relationship between two variables and thereby provides a mechanism for estimation or prediction or
forecasting.
“Regression analysis is an attempt to establish the nature of the relationship between variables-
that is to study the functional relationship between the variables and thereby provides a mechanism for
prediction or forecasting”.
It is clear from the above definitions that Regression Analysis is a statistical device with
the help of which we are able to estimate the unknown values of one variable from known values
of another variable. The variable which is used to predict the another variable, is called
independent variable (explanatory variable) and, the variable we are trying to predict is called
dependent variable (explained variable).
8
7.1.2 Multiple Regression
It is a type of regression which uses two or more independent variables to explain and/or predict
the dependent variable.
With a little algebra and differential calculators we can develop some equations (2 equations in
case of a linear relationship) called normal equations. By solving these normal equations, we can find out
the best values of the constants.
9
8.1 Moving Average
In Statistics, a moving average (rolling average or running average) is a calculation to analyze
data points by creating a series of averages of different subsets of the full data set. It is also called a
moving mean or rolling mean and is a type of finite impulse response filter.
Given a series of numbers and a fixed subset size, the first element of the moving average is
obtained by taking the average of the initial fixed subset of the number series. Then the subset is
modified by “shifting forward”, that is, excluding the first number of the series and including the next
value in the subset.
The seasonal variations
are calculated by the model:
If 𝑆1 = any individual stock level
and 𝑥̅𝑖 is any individual average
then
𝑥1 = 1⁄2 (𝑆1 + 𝑆2 );
̅̅̅
𝑥2 = 1⁄2 (𝑥
̅̅̅ ̅̅̅1 + 𝑆3 );
𝑥3 = 1⁄2 (𝑥
̅̅̅ ̅̅̅2 + 𝑆4 ); …
and so on.
A moving average is commonly used with time series data to smooth out short-term fluctuations
and highlight longer-term trends or cycles. The threshold between short-term and long-term depends on
the application, and the parameters of the moving average will be set accordingly.
8.3 Trend
One very valuable tool to our user is a trend analysis and we may well be asked to produce the
analysis of data which allow the necessary graph to be generated.
Time series graphs can show up “seasonal’ variations – where the values of the variable tend to
peak or trough at fairly regular intervals.
We can suppress these seasonal variations with a suitable moving average.
We may now plot the data on a graph (against the time to which they relate) and since the
‘average’ may be assumed to be moving continuously, not in decrease steps, as are the stock figures, the
moving average should be shown as a continuous, smooth line (curve).
Finally, we may attempt to draw a line of best fit (from the moving average points), which is an
attempt to interpret the moving average fluctuations as overall trend.
10
9. Two-layered chart
9.1 Control Chart
also known as Shewhart charts (after Walter A. Shewhart) or process-behavior charts, in statistical
process control are tools used to determine if a manufacturing or business process is in a state of
statistical control.
Purpose: To determine whether a process should undergo a formal examination for quality-related
problems
[Also called: statistical process control.
The control chart is a graph used to study how a process changes over time. Data are plotted in time
order. A control chart always has a central line for the average, an upper line for the upper control limit
and a lower line for the lower control limit. These lines are determined from historical data. By comparing
current data to these lines, you can draw conclusions about whether the process variation is consistent
(in control) or is unpredictable (out of control, affected by special causes of variation).
Control charts for variable data are used in pairs. The top chart monitors the average, or the centering of
the distribution of data from the process. The bottom chart monitors the range, or the width of the
distribution. If your data were shots in target practice, the average is where the shots are clustering, and
the range is how tightly they are clustered. Control charts for attribute data are used singly.]
11
Purpose: To assess the most frequently occurring defects by category†
12
A random variable 𝑋 can be discrete or continuous. If 𝑋 can take only finite or countably infinite
set of values, it is termed as a discrete random variable. On the other hand, if 𝑋 can take an uncountable
set of infinite values, it is called a continuous random variable.
The distribution o f a discrete random variable is called the Discrete Probability Distribution and
the corresponding probability function 𝑝(𝑋) is called a Probability Mass Function. In order that any
discrete function 𝑝(𝑋) may serve as probability function of a discrete random variable 𝑋, the following
conditions must be satisfied:
(i) 𝑝(𝑋𝑖 ) ≥ 0, ∀ 𝑖 = 1,2, … , 𝑛 and
(ii) ∑𝑛𝑖=1 𝑝(𝑋𝑖 ) = 1.
Variance: The concept of variance of random variable or its probability distribution is also similar to the
concept of the variance of a frequency distribution.
The variance of a frequency distribution is given by
1 𝑓
𝜎2 = ∑ 𝑓𝑖 (𝑋𝑖 − 𝑋̅)2 = ∑(𝑋𝑖 − 𝑋̅)2 ∙ 𝑖 = Mean of (𝑋𝑖 − 𝑋̅)2 values.
𝑁 𝑁
The expression for variance of a probability distribution with mean 𝜇 can be written in a similar way, as
given below:
𝜎 2 = 𝐸(𝑋 − 𝜇)2 = ∑𝑛𝑖=1(𝑋𝑖 − 𝜇)2 𝑝(𝑋𝑖 ), where 𝑋 is a discrete random variable.
Remarks: If 𝑋 is a continuous random variable with probability density function 𝑝(𝑋), then
∞
𝐸(𝑋) = ∫ 𝑋 ∙ 𝑝(𝑋)𝑑𝑋
−∞
∞
𝜎 2 = 𝐸(𝑋 − 𝜇)2 = ∫ (𝑋 − 𝜇)2 ∙ 𝑝(𝑋)𝑑𝑋
−∞
13
10.3 Classification of Probability Distributions
14
10.5 Poisson Distribution
The Poisson distribution is defined as follows:
𝜆𝑘 𝑒 −𝜆
𝑝(𝑘; 𝜆) = , 𝑘 = 0, 1, 2, …
𝑘!
where 𝜆 > 0 is some constant. It is a discrete
probability distribution that expresses the
probability of a given number of events occurring
in a fixed interval of time or space if these events
occur with a known constant rate and
independently of the time since the last event.
This countably infinite distribution appears in
many natural phenomena, such as the number of patients arriving in an emergency room between
10 and 11 pm, the number of telephone calls per minute at some switchboard, the number of misprints
per page in a large text, and the number of 𝛼 particles emitted by a radioactive substance.
Properties of the Poisson distribution follow:
Poisson distribution
Mean 𝜇=𝜆
Variance 𝜎2 = 𝜆
Standard deviation 𝜎 = √𝜆
15
10.7 Normal Distribution
The normal (or: Gaussian)
distrib1ution or curve is defined as
follows:
1 𝑥−𝜇 2
1 − ( )
𝑓(𝑥) = 𝑒 2 𝜎
𝜎√2𝜋
Where 𝜇 and 𝜎 > 0 are arbitrary
constants. This function is certainly one of
the most important examples of a
continuous probability distribution.
Properties of the Normal distribution follow:
Normal distribution
Mean 𝜇
Variance 𝜎2
Standard deviation 𝜎
We denote the above normal distribution with mean 𝜇 and variance 𝜎2 by
𝑁(𝜇, 𝜎 2 ).
If we make the substitution 𝑡 = (𝑥 − 𝜇)⁄𝜎 in the above formula for 𝑁(𝜇, 𝜎 2 ) we obtain the standard
normal distribution or curve
1 1⁄ 𝑡 2
∅(𝑡) = 𝑒− 2
√2𝜋
Which has mean 𝜇 = 0 and variance 𝜎2 = 1.
16
10.8 Exponential Distribution
The exponential distribution (also
known as the negative exponential
distribution) is the probability distribution
that describes the time between events in a
Poisson point process, i.e., a process in
which events occur continuously and
independently at a constant average rate.
The probability density function (pdf) of an
exponential distribution is
−𝜆𝑥
𝑓(𝑥; 𝜆) = {𝜆𝑒 𝑥≥0,
0 𝑥<0.
Here 𝜆 > 0 is the parameter of the distribution,
ofetn called the rate parameter. The distribution is supported on the inteval [0, ∞).
Properties of the Exponential distribution follow:
Exponential distribution
1
Mean 𝜇=
𝜆
1
Variance 𝜎2 = 2
𝜆
1
Standard deviation 𝜎=
𝜆
17
11. Bayes rule
True Bayesians actually consider conditional probabilities as more basic than joint probabilities. It
is easy to define 𝑃(𝐴|𝐵) without reference to the joint probability 𝑃(𝐴, 𝐵). To see this note that we can
rearrange the conditional probability formula to get:
𝑃(𝐴|𝐵)𝑃(𝐵) = 𝑃(𝐴, 𝐵)
but by symmetry we can also get:
𝑃(𝐵|𝐴)𝑃(𝐴) = 𝑃(𝐴, 𝐵)
It follows that:
𝑃(𝐵|𝐴)𝑃(𝐴)
𝑃(𝐴|𝐵) =
𝑃(𝐵)
which is the so-called Bayes Rule.
It is common to think of Bayes rule in terms of updating our belief about a hypothesis 𝐴 in the light of
new evidence 𝐵. Specifically, our posterior belief 𝑃(𝐴|𝐵) is calculated by multiplying our prior belief 𝑃(𝐴)
by the likelihood 𝑃(𝐵|𝐴) that B will occur if 𝐴 is true.
The power of Bayes' rule is that in many situations where we want to compute 𝑃(𝐴|𝐵) it turns out that it
is difficult to do so directly, yet we might have direct information about 𝑃(𝐵|𝐴). Bayes' rule enables us to
compute 𝑃(𝐴|𝐵) in terms of 𝑃(𝐵|𝐴).
For example, suppose that we are interested in diagnosing cancer in patients who visit a chest clinic.
Let 𝐴 represent the event "Person has cancer".
Let 𝐵 represent the event "Person is a smoker".
We know the probability of the prior event 𝑃(𝐴) = 0.1 on the basis of past data (10% of patients
entering the clinic turn out to have cancer). We want to compute the probability of the posterior event
𝑃(𝐴|𝐵). It is difficult to find this out directly. However, we are likely to know 𝑃(𝐵) by considering the
percentage of patients who smoke – suppose 𝑃(𝐵) = 0.5. We are also likely to know 𝑃(𝐵|𝐴) by checking
from our record the proportion of smokers among those diagnosed. Suppose 𝑃(𝐵|𝐴) = 0.8.
We can now use Bayes' rule to compute:
0.8×0.1
𝑃(𝐴|𝐵) = = 0.16.
0.5
Thus, in the light of evidence that the person is a smoker we revise our prior probability from 0.1 to a
posterior probability of 0.16. This is a significance increase, but it is still unlikely that the person has
cancer.
The denominator 𝑃(𝐵) in the equation is a normalising constant which can be computed, for example,
by marginalisation whereby
𝑃(𝐵) = ∑𝑖 𝑃(𝐵, 𝐴𝑖 ) = ∑𝑖 𝑃(𝐵|𝐴𝑖 ) ∙ 𝑃(𝐴𝑖 ).
Hence we can state Bayes rule in another way as:
𝑃(𝐵|𝐴)∙𝑃(𝐴)
𝑃(𝐴|𝐵) = ∑ .
𝑖 𝑃(𝐵|𝐴𝑖 )∙𝑃(𝐴𝑖 )
18
12. Programming Techniques:
Programming techniques are also called operations research techniques. Programming techniques are
model building techniques used by decision makers in modern times.
Programming techniques involve:
12.7 Simulation:
It is a technique of testing a model which resembles real life situations.
19
12.9 Non Linear Programming:
It is a programming technique which involves finding an optimum solution to a problem in which some or
all variables are non-linear.
12.10 Sequencing:
Sequencing tool is used to determine a sequence in which given jobs should be performed by minimizing
the total efforts.
20
13.2 Last-in First-out method (LIFO)
LIFO is the opposite of FIFO and stands for ‘last in, first out.’ It’s currently the inventory method used by
Target. In this case, rather than assume you’re selling your first acquired products first, you assume
you’re selling your most recently (last) acquired products first.
21