0% found this document useful (0 votes)
2 views11 pages

Stats Probability Guide

This document is a comprehensive study guide for HND Level 2 in Software Engineering, focusing on Statistics and Probability. It covers key concepts such as ungrouped and grouped data, measures of central tendency, variance, correlation, regression, and various probability distributions including Binomial, Poisson, and Normal distributions. Each section includes definitions, formulas, and examples to aid understanding.

Uploaded by

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

Stats Probability Guide

This document is a comprehensive study guide for HND Level 2 in Software Engineering, focusing on Statistics and Probability. It covers key concepts such as ungrouped and grouped data, measures of central tendency, variance, correlation, regression, and various probability distributions including Binomial, Poisson, and Normal distributions. Each section includes definitions, formulas, and examples to aid understanding.

Uploaded by

ndengafranck771
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

HND LEVEL 2 — SOFTWARE ENGINEERING

Statistics & Probability


A Complete Study Guide with Properly Formatted Formulas

Page 1 | Statistics & Probability — HND Level 2


Chapter 1: Statistics
Statistics is the science of collecting, organising, analysing, and interpreting numerical data. We distinguish
between ungrouped (raw) data and grouped data.

1. Ungrouped (Raw) Data


Ungrouped data consists of individual observations that have not yet been sorted into class intervals.

1.1 Mean
Population Mean
N

∑ x ii
μ= i=1
N
Sample Mean
n

∑ x ii
x̄ = i=1
n
1.2 Median
DEFINITION
Sort the data in ascending order, then:
• n is ODD → median = value at position (n + 1) / 2
• n is EVEN → median = average of values at positions n/2 and n/2 + 1

1.3 Mode
The value that occurs most frequently. A dataset can be unimodal, bimodal, or multimodal.

1.4 Variance & Standard Deviation


Population Variance
N

∑ ()❑2
σ ²= i=1
N
Sample Variance (Bessel's Correction)
n

∑ ()❑2
s ²= i=1
n −1
Standard Deviation

σ =√ σ ²∨s=√ s ²

Computational shortcut for sample variance (avoids computing each deviation):


s² = [ Σxᵢ² − (Σxᵢ)² / n ] / (n − 1)

Page 2 | Statistics & Probability — HND Level 2


1.5 Quartiles & IQR
Quartiles divide sorted data into four equal parts. The Interquartile Range measures the spread of the
middle 50%.
Interquartile Range

IQR=Q 33 −Q 11

EXAMPLE — Ungrouped Data


Dataset: 4, 7, 2, 9, 4, 6, 4

Mean: x̄ = (4+7+2+9+4+6+4) / 7 = 36/7 ≈ 5.14


Sorted: 2, 4, 4, 4, 6, 7, 9 → Median = 4, Mode = 4
Variance: s² = [(4−5.14)² + (7−5.14)² + …] / 6 ≈ 4.81

2. Grouped Data
When data is large it is organised into class intervals with corresponding frequencies. Each class is
represented by its midpoint mᵢ.

2.1 Mean of Grouped Data


Grouped Mean
❑ ❑


f i i · m ii ∑ f i i · m ii

x̄ = ❑
=
n


f ii

2.2 Median of Grouped Data


Grouped Median — Linear Interpolation

n/2 − F
Median=L+ ×h
f mm

NOTATION
L = lower boundary of the median class
n = total frequency
F = cumulative frequency before the median class
f_m = frequency of the median class
h = class width

2.3 Mode of Grouped Data (Czuber's Formula)


Grouped Mode

f mm −f 11
Mode=L+ ×h
( f mm − f 11)+(f mm − f 22 )
f₁ = frequency before modal class; f₂ = frequency after modal class.

2.4 Variance of Grouped Data


Grouped Variance

Page 3 | Statistics & Probability — HND Level 2





f ii ()❑
2

s ²=
n−1

EXAMPLE — Grouped Data


Class mᵢ fᵢ fᵢ·mᵢ
10–19 14.5 3 43.5
20–29 24.5 7 171.5
30–39 34.5 12 414.0
40–49 44.5 8 356.0
─────────────────────────────
Total — 30 985.0

Mean = 985 / 30 ≈ 32.83

3. Correlation
Correlation measures the strength and direction of a linear relationship between two quantitative variables
X and Y.

3.1 Pearson's Correlation Coefficient r


Pearson's r — Computational Formula
❑ ❑ ❑
n ∑ x ii y ii −( ∑ x i i )(∑ y i i )
❑ ❑ ❑
r=
√()· √()
Pearson's r — Alternative Definition



()()
r=
(n −1)· s x x · s y y

3.2 Interpreting r
|r| Value Interpretation
1.0 Perfect linear
0.7 – 0.99 Strong
0.4 – 0.69 Moderate
0.1 – 0.39 Weak
0 No linear relationship

3.3 Spearman's Rank Correlation ρ


Spearman's ρ

6 · ∑ d ii
2


ρ=1−
n(n ² −1)
dᵢ = rank(xᵢ) − rank(yᵢ). Used when data is ordinal or not normally distributed.

Page 4 | Statistics & Probability — HND Level 2


Note: Correlation does NOT imply causation.
A high |r| only indicates a linear association, not that one variable causes the other.

4. Linear Regression
Regression finds the equation of the best-fit line to predict one variable from another.

4.1 Regression Line


Least-Squares Regression Line

ŷ=a+bx
4.2 Least-Squares Coefficients
Slope b
❑ ❑ ❑
n· ∑ x ii y ii −(∑ x i i )( ∑ y i i )
❑ ❑ ❑
b= ❑
n · ∑ x ii − ¿ ¿
2

Intercept a

a= ȳ −b · x̄
4.3 Coefficient of Determination R²
Proportion of variation in Y explained by X. Ranges from 0 (no fit) to 1 (perfect fit).
R-squared

SS resres
R ²=r ²=1 −
SS tot tot
Sum of Squares
❑ ❑
SS tot tot =∑ ()❑ SS res res =∑ ()❑
2 2

❑ ❑

4.4 Standard Error of the Estimate


Standard Error Sₑ





()❑2
S ee=
n −2

EXAMPLE — Regression Line


Data: (1,2) (2,4) (3,5) (4,4) (5,5)
n=5, Σx=15, Σy=20, Σxy=66, Σx²=55

b = [5(66) − 15(20)] / [5(55) − 225] = 30/50 = 0.6


a = 4 − 0.6(3) = 2.2

Page 5 | Statistics & Probability — HND Level 2


Regression line: ŷ = 2.2 + 0.6x

Page 6 | Statistics & Probability — HND Level 2


Chapter 2: Probability Distributions
A probability distribution describes all possible values a random variable can take and their associated
probabilities.
Discrete: Countable outcomes — described by a Probability Mass Function (PMF): P(X = x)
Continuous: Uncountable range — described by a Probability Density Function (PDF): f(x)
CDF: Cumulative Distribution Function F(x) = P(X ≤ x) applies to both types.

5. Binomial Distribution
Binomial Distribution DISCRETE

Models the number of successes in a fixed number n of independent Bernoulli trials, each with probability
of success p.
Conditions: Fixed n · only two outcomes per trial · constant p · independent trials.
Probability Mass Function (PMF)

n! k n−k
P( X=k )= · p ·()
k ! (n −k )!

Notation: X ~ B(n, p) Mean: μ = np


Variance: σ² = np(1−p) Std Dev: σ = √(np(1−p))

EXAMPLE — Binomial
A fair coin is tossed 8 times. Find P(exactly 5 heads).
X ~ B(8, 0.5)
P(X=5) = 8!/(5!3!) · (0.5)⁵ · (0.5)³ = 56 × (1/256) ≈ 0.2188

6. Poisson Distribution
Poisson Distribution DISCRETE

Models the number of events in a fixed interval given a known average rate λ and independence between
events.
Probability Mass Function (PMF)
−λ k
e ·λ
P( X=k )=
k!
Notation: X ~ Po(λ) Mean: μ = λ
Variance: σ² = λ Property: Mean = Variance

Binomial → Poisson Approximation: when n ≥ 20 and p ≤ 0.05, use λ = np.

Page 7 | Statistics & Probability — HND Level 2


EXAMPLE — Poisson
Calls arrive at 3 per minute. P(exactly 2 in a minute)?
P(X=2) = (e^(−3) · 3²) / 2! = (0.04979 × 9) / 2 ≈ 0.2240

7. Normal Distribution
Normal (Gaussian) Distribution CONTINUOUS

The most important distribution in statistics. Symmetric and bell-shaped, described fully by μ and σ.
Probability Density Function (PDF)

1
f ( x)= · exp( )
σ √2 π
Standardisation — Z-Score
Convert any normal to the Standard Normal Z ~ N(0, 1) via:
Z-Score

X− μ
Z=
σ
Notation: X ~ N(μ, σ²) Mean: μ
Variance: σ² Skewness: 0 (symmetric)

Range % of Data
μ±σ 68.27 %
μ ± 2σ 95.45 %
μ ± 3σ 99.73 %

Normal Approximation to Binomial: when np ≥ 5 and n(1−p) ≥ 5,


use μ = np, σ² = np(1−p). Apply continuity correction: P(X=k) ≈ P(k−0.5 ≤ Y ≤ k+0.5).

8. Uniform Distribution
Uniform Distribution CONT. & DISC.

All outcomes in the range are equally likely.

Continuous Uniform U(a, b)


PDF

1
f (x)= , a≤ x ≤b
b−a
Mean: (a + b) / 2 Variance: (b − a)² / 12

Page 8 | Statistics & Probability — HND Level 2


Discrete Uniform
1
P( X=x i i )= , i=1 , 2 ,… , n
n

EXAMPLE — Uniform
Bus arrives uniformly between 2:00 and 2:10 pm.
P(waiting more than 6 min)?
X ~ U(0, 10): P(X > 6) = (10 − 6) / 10 = 0.4

9. Exponential Distribution
Exponential Distribution CONTINUOUS

Models waiting time between Poisson events. Has the unique memoryless property.
PDF
− λx
f ( x)=λ · e , x≥0
CDF
− λx
F (x)=1 − e

Notation: X ~ Exp(λ) Mean: 1 / λ


Variance: 1 / λ² Memoryless: P(X>s+t | X>s) = P(X>t)

EXAMPLE — Exponential
Average time between requests = 2 s (λ = 0.5).
P(next request within 3 s)?
P(X ≤ 3) = 1 − e^(−0.5×3) = 1 − e^(−1.5) ≈ 0.7769

10. Geometric Distribution


Geometric Distribution DISCRETE

Models the number of Bernoulli trials needed to get the first success. Discrete analogue of the Exponential.
PMF — Number of Trials Until First Success
k −1
P( X=k )=( ) · p , k=1 , 2 ,3 , …

Notation: X ~ Geo(p) Mean: 1 / p


Variance: (1−p) / p² CDF: P(X ≤ k) = 1 − (1−p)ᵏ

EXAMPLE — Geometric
P(defective item) = 0.1. First defective is the 4th item?
P(X=4) = (0.9)³ × 0.1 = 0.729 × 0.1 = 0.0729

Page 9 | Statistics & Probability — HND Level 2


11. Hypergeometric Distribution
Hypergeometric Distribution DISCRETE

Models sampling without replacement from a finite population of size N with K successes.
SETUP
Population N · K successes · N−K failures · Sample size n (no replacement)

PMF

K! (N − K)!
·
k !(K − k)! (n− k )! (N − K −n+ k )!
P( X=k )=
N!
n ! (N −n)!

Notation: X ~ HG(N, K, n) Mean: μ = nK / N


FPC: (N−n)/(N−1) — finite population
n·(K/N)·((N−K)/N)·((N−n)/(N−1)) correction
Variance:

EXAMPLE — Hypergeometric
Lot of 20 items, 4 defective. Sample 5 without replacement.
P(exactly 1 defective)?
P(X=1) = C(4,1)·C(16,4) / C(20,5) = 4×1820/15504 ≈ 0.4696

Page 10 | Statistics & Probability — HND Level 2


Quick Reference — Distribution Summary

Distribution Type Notation Mean Variance Key Use


Binomial Discrete B(n,p) np np(1−p) Fixed trials, 2 outcomes
Poisson Discrete Po(λ) λ λ Events per interval
Geometric Discrete Geo(p) 1/p (1−p)/p² Trials to first success
Hypergeometric Discrete HG(N,K,n) nK/N (formula) Sampling w/o replacement
Uniform Continuous U(a,b) (a+b)/2 (b−a)²/12 Equal-probability range
Exponential Continuous Exp(λ) 1/λ 1/λ² Waiting times
Normal Continuous N(μ,σ²) μ σ² Natural phenomena, CLT

HND Software Engineering · Statistics & Probability · IUC SEAS

Page 11 | Statistics & Probability — HND Level 2

You might also like