Section 1 · 7 min read
Probability and statistics
Probability rules, conditional probability and Bayes theorem, random variables, the uniform, binomial, Poisson, exponential and normal distributions, and mean, median, mode and standard deviation.
On this page
Probability is one of the highest scoring parts of the mathematics section in GATE CS, typically worth 2 to 4 marks, and many of the questions are numerical answer type. Most problems combine a counting step with one of a few rules: complement, total probability, Bayes, linearity of expectation, or a standard distribution.
Basic rules
For events in a sample space :
- , , .
- .
- For equally likely outcomes: .
Conditional probability: for .
Multiplication rule: .
Independence: and are independent iff . Mutually exclusive events with nonzero probabilities are never independent, because . Pairwise independence of three events does not imply mutual independence.
Total probability and Bayes theorem
If partition the sample space,
A tree diagram is the cleanest way to organise these: branch first on the cause (), then on the observation (), multiply along branches, and divide the branch you want by the total of all branches that end in .
Random variables
A discrete random variable has a probability mass function with . A continuous one has a density with , and . For continuous , for every single value .
The cumulative distribution function is . It is non-decreasing, goes from 0 to 1, and for continuous .
Expectation and variance
- Linearity: , always, even for dependent variables.
- .
- when are independent (more generally, uncorrelated).
- for independent .
- Standard deviation .
Indicator trick: to find the expected count of something, write the count as a sum of indicator variables and use . For example, the expected number of fixed points of a random permutation of elements is .
Standard distributions
| Distribution | PMF or PDF | Mean | Variance |
|---|---|---|---|
| Bernoulli() | , | ||
| Binomial() | |||
| Geometric(), trials until first success | , | ||
| Poisson() | |||
| Uniform() | on | ||
| Exponential() | , | ||
| Normal() |
Discrete uniform on : mean , variance .
Notes on each
- Binomial: number of successes in independent trials with the same . Given the mean and variance, .
- Poisson: counts of rare events in a fixed interval. It approximates Binomial() with when is large and small. The sum of independent Poisson() and Poisson() is Poisson(). If the rate is per unit time, the count in time is Poisson().
- Exponential: waiting time between Poisson events. . It is memoryless: . Mean equals standard deviation. The minimum of independent exponentials with rates is exponential with rate .
- Normal: symmetric about , so mean = median = mode. Standardise with . Roughly 68%, 95% and 99.7% of the mass lies within 1, 2 and 3 standard deviations. A linear function of a normal variable is normal with mean and variance . The sum of independent normals is normal.
- Uniform: probabilities are lengths (or areas, for two independent uniforms on a square) divided by the total.
Descriptive statistics
For data :
- Mean .
- Median: middle value after sorting; for even , the average of the two middle values.
- Mode: most frequent value (there can be several).
- Variance (population) . The sample variance divides by instead. GATE usually means the population version unless it says "sample".
- Adding a constant to every value shifts mean, median and mode by that constant and leaves the variance unchanged. Multiplying by scales the mean by and the variance by .
- For a moderately skewed distribution, an empirical relation is .
- In a right-skewed (long right tail) data set, typically mode < median < mean; left-skewed reverses it.
Worked examples
Worked example 1: Bayes with three sources
Machines produce 50%, 30% and 20% of the items in a factory, with defect rates 1%, 2% and 3%. An item is found defective. What is the probability that made it?
- Branch products: , , .
- .
- .
Worked example 2: Expected value by indicators
Each of 10 people throws their hat into a pile and takes one back at random. Each of 6 balls is then thrown independently into one of 4 bins. Find (a) the expected number of people who get their own hat, and (b) the expected number of empty bins.
(a) Each person has probability of getting their own hat, so the expected number is .
(b) A given bin stays empty with probability , so the expected number of empty bins is .
Linearity works even though the events are dependent.
Worked example 3: Poisson count
Requests arrive at a server as a Poisson process at 3 per second. What is the probability of at least 2 requests in a given second?
Worked example 4: Continuous density
has density on . Find and .
- , so .
- .
Worked example 5: Geometric waiting
A fair die is rolled until a 6 appears. What is the probability that more than 3 rolls are needed, and what is the expected number of rolls?
- More than 3 rolls means the first 3 are not 6: .
- Geometric with : .
Common traps
- Treating mutually exclusive as independent.
- Dividing by the wrong total in Bayes: the denominator is the probability of the observed evidence, summed over all causes.
- Writing . The constant disappears and is squared.
- Adding variances of dependent variables.
- Forgetting memorylessness: for an exponential lifetime, the time already survived does not matter.
- Using the Poisson rate for the wrong interval length. Scale to the interval asked.
- In "at least one" questions, multiplying the success probabilities instead of using .
- Confusing population and sample variance.
Quick revision
- ; .
- Bayes: prior times likelihood, divided by the sum over all causes.
- is always linear; variances add only for independent variables.
- ; .
- Binomial: , . Poisson: mean = variance = .
- Uniform: , .
- Exponential: mean , , memoryless.
- Normal: ; mean = median = mode.
- Geometric: mean ; .
- Indicator variables turn expected counts into sums of probabilities.