View Categories

Statistics

What is Statistics? #

Statistics is the study of collecting, analyzing, and interpreting data to find patterns and make decisions.

Mean (Average) #

The mean is the average of all values.

Formula: #

Mean = Sum of values / Total number of values

Example:

Data=[2,4,6,8]Mean=(2+4+6+8)/4=5Data = [2, 4, 6, 8]Mean = (2 + 4 + 6 + 8) / 4 = 5

Median #

The median is the middle value when data is sorted.

Example: #

Data=[1,3,5]Median=3Data = [1, 3, 5]Median = 3

Even case:

Data=[1,3,5,7]Median=(3+5)/2=4Data = [1, 3, 5, 7]Median = (3 + 5) / 2 = 4

Mode #

The mode is the value that appears most frequently.

Example: #

Data=[2,2,3,4]Mode=2Data = [2, 2, 3, 4]Mode = 2

Variance #

Variance measures how far data is spread from the mean.

Formula: #

Variance=Σ(xmean)2/nVariance = Σ (x – mean)² / n

Example:

Data = [2, 4, 6]

Mean = 4

Variance = [(2-4)² + (4-4)² + (6-4)²] / 3
         = (4 + 0 + 4) / 3
         = 2.67

Standard Deviation #

Standard deviation is the square root of variance.

Formula: #

Standard Deviation = √Variance

Example:

SD = √2.67 ≈ 1.63
SD = √2.67 ≈ 1.63

Probability Basics #

Probability measures the chance of an event happening.

Formula: #

Probability = Favorable outcomes / Total outcomes

Example:

Coin toss:

P(Heads) = 1 / 2 = 0.5

Basic Python Example

import numpy as np

data = [2, 4, 6, 8, 8]

# Mean
print("Mean:", np.mean(data))

# Median
print("Median:", np.median(data))

# Mode (simple way)
from collections import Counter
print("Mode:", Counter(data).most_common(1)[0][0])

# Variance
print("Variance:", np.var(data))

# Standard Deviation
print("Std Dev:", np.std(data))

💬
AIRA (AI Research Assistant) Neural Learning Interface • Drag & Resize Enabled
×