MCS-211 · Block 1 Unit 2

Some Pre-requisites and Asymptotic Bounds

Section 3 of 8

Block 1 · Unit 2Some Pre-requisites and Asymptotic Bounds9 min · Section 3 of 8

2.3Proof Vocabulary and Mathematical Expectation

Covers IGNOU MCS-211 §2.2.4, 2.3

Algorithm analysis uses proofs (to show an algorithm is correct or a bound holds) and probability (to find average-case running times). This page explains the words used in proofs and the one probability idea you need most: the expected value.

The vocabulary of proofs

TermMeaningExample
Statement / propositionA sentence that is either true or false (not both).“5 > 8” (false); “3 is prime” (true)
ConjectureA proposition believed true but not yet proved.Goldbach’s conjecture
TheoremA proposition that has been proved true, usually an important one.∑i=1ni2=n(n+1)(2n+1)6\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6} for all n≥1n \ge 1
LemmaA smaller proved result used as a step in proving a theorem.“Each pass of bubble sort moves the largest remaining item to the end.”
CorollaryA result that follows from a theorem with little extra proof.From “every polynomial of degree mm with am>0a_m > 0 is Θ(nm)\Theta(n^m)”: "7n2+2n+3=Θ(n2)7n^2 + 2n + 3 = \Theta(n^2)"

“What is 5 + 3?” or “Sort this list!” are not propositions: a question or a command is neither true nor false.

Mathematical expectation

It is a weighted average: each value counts in proportion to how likely it is.

Python · expectation.py
from fractions import Fraction

# Example: mid-point of each marks range and the share of students in it.
marks = [10, 30, 50, 70, 90]
share = [8, 20, 57, 9, 6]          # percent of students, adds up to 100
expected = sum(Fraction(p, 100) * v for p, v in zip(share, marks))
print("expected marks =", expected, "%")

# A fair six-sided die: each face has probability 1/6.
die = sum(Fraction(1, 6) * v for v in range(1, 7))
print("expected die value =", die, "=", float(die))
Output
expected marks = 47 %
expected die value = 7/2 = 3.5

Expectation in algorithm analysis

The average-case running time is an expected value: the values are the numbers of steps on different inputs, and the probabilities come from an assumption about which inputs are likely. In Unit 1, linear search on nn elements makes ii comparisons with probability 1/n1/n for each ii, so Cavg(n)=∑i=1n1n⋅i=1n⋅n(n+1)2=n+12.C_{\text{avg}}(n) = \sum_{i=1}^{n} \frac{1}{n} \cdot i = \frac{1}{n} \cdot \frac{n(n+1)}{2} = \frac{n+1}{2}. The sum formula from the first section turns the expectation into a closed form.

Key takeaways

  • A proposition is true or false; a theorem is a proved proposition; a lemma helps prove a theorem; a corollary follows easily from one.
  • Expected value: E=∑piviE = \sum p_i v_i with probabilities adding to 1.
  • Expected value is a weighted average, not a plain average.
  • Average-case analysis computes the expected number of steps.

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

Which of these is a proposition?

Show answer

Answer: B. “17 is an even number.”

“17 is an even number” is a sentence that is false, so it is a proposition. A question, a command and an expression are neither true nor false.

Question 2 · multiple choice

A small result proved only to help prove a bigger theorem is called a:

Show answer

Answer: C. lemma

A lemma is a helper result. A corollary comes after a theorem, as an easy consequence.

Question 3 · multiple choice

A game pays ₹10 with probability 0.2 and ₹0 otherwise. What is the expected payment?

Show answer

Answer: B. ₹2

E = 0.2 × 10 + 0.8 × 0 = 2. ₹5 is the plain average of 10 and 0, which ignores the probabilities.

Question 4 · multiple choice

What is the expected value of a fair six-sided die?

Show answer

Answer: D. 3.5

(1 + 2 + 3 + 4 + 5 + 6)/6 = 21/6 = 3.5. 21 is the sum before dividing by 6.

Question 5 · multiple choice

Which statement about a theorem is correct?

Show answer

Answer: A. It is a proposition that has been proved true.

A proposition still waiting for a proof is a conjecture; once proved, it becomes a theorem.

Question 6 · short answer

A search finds its key after 1, 2 or 3 comparisons with probabilities 0.5, 0.3 and 0.2. Find the expected number of comparisons.

Show worked answer

E = 1(0.5) + 2(0.3) + 3(0.2) = 0.5 + 0.6 + 0.6 = 1.7 comparisons. (The probabilities 0.5 + 0.3 + 0.2 add up to 1, so the formula applies.)

↑ ↓ move↵ openTab switch type