JnU B.Sc. in CSE — 3rd Year 1st Semester, Mid Term 3 (14th Batch, Solved)
Created ৯ আগ, ২০২৬
Two questions, worth 5 marks each — a Markov chain transition probability matrix problem, and a one-sample z-test for hypothesis testing.
Question 1 — Markov Chain: TV Watching vs Reading
A person spends his evening either watching TV (T) or reading books (R). If he watches TV today, tomorrow he is twice as likely to watch TV again as to read. If he reads today, then tomorrow he certainly watches TV.
Write the transition probability matrix (TPM).
If initially he starts with reading, find the probability that he reads after two days.
Concept Needed
A Markov chain is a random process where the next state depends only on the current state, not on the past history. The Transition Probability Matrix (TPM) lists the probability of moving from every state to every other state in one step. Each row of a TPM must sum to 1, since from a given state the person must go to some state tomorrow.
Given / Required
Two states: T = Watching TV, R = Reading.
If today is T: tomorrow is twice as likely to be T as R, so P(T→T):P(T→R)=2:1.
If today is R: tomorrow is certainly T, so P(R→T)=1, P(R→R)=0.
Required: (i) the TPM P, (ii) P(reads on day 2∣reads on day 0).
Step 1: Split the Ratio 2:1 into Probabilities
Since P(T→T):P(T→R)=2:1 and the two probabilities must add to 1:
P(T→T)=32,P(T→R)=31
Step 2: Use the Given Certain Transition from R
P(R→T)=1,P(R→R)=0
Step 3: Write the TPM
Transition Probability Matrix (rows = from, columns = to)
from \ to
T
R
T
2/3
1/3
R
1
0
Transition Probability Matrix
P=(2/311/30)(rows/columns in order T,R)
Check: Row sums =32+31=1 and 1+0=1. Both rows sum to 1, so the TPM is valid.
(Note: R has no self-loop, since P(R→R)=0 — every time he reads, he is guaranteed to watch TV the next day.)
Since π0=(0,1), we pick out the second row of P2 (the row corresponding to starting state R):
π2=π0P2=(01)(7/92/32/91/3)=(2/31/3)
So after two days: P(T)=32, P(R)=31.
Verification
Cross-check with a direct step-by-step method:
Day 0: He reads (R), for certain.
Day 1: Since he read on Day 0, tomorrow he certainly watches TV, so Day 1 =T with probability 1.
Day 2: Since Day 1 was T, on Day 2: P(T)=32, P(R)=31.
This matches Step 6 exactly, confirming the matrix method.
Final Answer
P=(2/311/30),P(reads after two days)=31≈0.3333
Exam Tip
Always write the TPM with rows summing to 1 — this is the fastest self-check in the exam. "After n days" from a fixed starting state simply means: pick the row of Pn corresponding to the starting state.
Common Mistake
Multiplying P×P in the wrong order, or mixing up rows and columns — row is the "from" state, column is the "to" state. Also, forgetting that R has zero probability of self-transition; some students wrongly assume symmetry between T and R.
Quick Revision Point
If π0 is the initial distribution (as a row vector) and P is the TPM, then the distribution after n steps is πn=π0Pn.
Question 2 — Hypothesis Testing: One-Sample z-Test for Bulb Lifetime
A factory claims that the average lifetime of its bulbs is 1200 hours. A random sample of 49 bulbs gives:
Sample mean: xˉ=1202.62 hours
Population standard deviation (known): σ=7 hours
Significance level: α=0.05
Assume the population standard deviation is known, so use a z-test.
Concept Needed
A one-sample z-test is used to test a claim about a population mean μ when the population standard deviation σ is known.
z-test statistic
z=σ/nxˉ−μ0
Compare the computed z with the critical value from the standard normal (z) table, or compare the p-value with α.
Given / Required
Claimed (population) mean μ0=1200 hours, sample size n=49, sample mean xˉ=1202.62 hours, population standard deviation σ=7 hours, significance level α=0.05.
Required: test whether the factory's claim (μ=1200 hours) is statistically supported by the sample data, at α=0.05.
Step 1: State the Hypotheses
H0:μ=1200 hours (the factory’s claim is true)
H1:μ=1200 hours (two-tailed test — the true mean differs from 1200)
Step 2: Choose the Test and Significance Level
Since σ is known and n=49 is reasonably large, use the z-test. This is a two-tailed test at α=0.05, so each tail has area α/2=0.025. The critical value is z0.025=1.96 (standard table value).
Step 3: Compute the Test Statistic
Standard error:
nσ=497=77=1
Test statistic:
z=11202.62−1200=12.62=2.62
Step 4: Decision Rule (Critical Value Method)
Reject H0 if ∣z∣>z0.025=1.96. Here, ∣z∣=2.62>1.96, so reject H0.
Verification: Cross-Check with the p-Value Method
From the z-table, for z=2.62: Φ(2.62)=0.9956. So the one-tail area beyond z=2.62 is:
P(Z>2.62)=1−0.9956=0.0044
For a two-tailed test, double this:
p-value=2×0.0044=0.0088
Since p-value=0.0088<α=0.05, we again reject H0 — this matches Step 4 exactly, confirming the decision.
Two-tailed rejection regions at α = 0.05
Region
Description
z<−1.96
Rejection region (lower tail)
−1.96≤z≤1.96
Acceptance region for H0
z>1.96
Rejection region (upper tail) — observed z=2.62 falls here
Step 5: Conclusion
Final Answer
Since z=2.62>1.96 (equivalently, p=0.0088<0.05), we reject the null hypothesis H0. There is sufficient statistical evidence, at the 5% significance level, that the true average lifetime of the bulbs is different from — in fact, greater than — the factory's claimed 1200 hours.
Exam Tip
Always check whether the test is one-tailed or two-tailed before picking the critical value from the table. Since the claim here is just "the mean is 1200" with no direction specified, treat it as two-tailed. When n=49, simplify n=7 immediately — it makes the arithmetic much easier.
Common Mistake
Using z0.05=1.645 (one-tailed value) instead of z0.025=1.96 (two-tailed value) by mistake. Forgetting to double the tail probability when computing a two-tailed p-value.
Quick Revision Point
"Known σ ⟹ use z; unknown σ ⟹ use t." The 95% confidence interval for μ is xˉ±z0.025(σ/n)=1202.62±1.96(1)=(1200.66,1204.58) hours. Since 1200 lies outside this interval, this also confirms that H0 should be rejected.