# Q2 (2 marks)

Subject: Natural Language Processing

Exam: M2

Reader: https://deep-learning-study-room.vercel.app/nlp/#m2/mocks/mock-b/q2

Canonical: https://deep-learning-study-room.vercel.app/read/nlp/m2/mocks/mock-b--q2/

M2 · confirmed 2 + 2 + any two of 3 + 3 + 3 · worked practice

### Q2

A first-order Markov model starts in state A with probability 0.7. P(B|A)=0.4 and P(A|B)=0.3. Compute the path probability A→B→A, with no end-state factor. (2 marks)

**Given**

Start A=0.7; A→B=0.4; B→A=0.3.

**To find**

Probability of this state path.

### Formula and why it applies



$$
P(A,B,A)=P(A)P(B\mid A)P(A\mid B)
$$



First-order dependence uses only the previous state for each transition.

### Solution

#### Step 1. First transition contribution



$$
0.7\times0.4=0.28
$$



#### Step 2. Second transition contribution



$$
0.28\times0.3=0.084
$$



Path probability=0.084.
