The postmark on letter from either KRISHNAGIRI or DHARMAPURI has only "RI" visible. What is the chance the letter came from KRISHNAGIRI? 
A letter is known to have come either from "KRISHNAGIRI" or "DHARMAPURI". On the post mark only the two consecutive letters "RI" are visible. Then the chance that it came from KRISHNAGIRI is ...


My solution:
In "KRISHNAGIRI" we have two RI
In "DHARMAPURI" we have one RI
Therefore, the probability it came from "KRISHNAGIRI" is 2/3.
But the answer is 9/14. I am not able to get this answer.
 A: Recall Bayes' theorem: $P(A|B)=\frac{P(B|A)P(A)}{P(B)}$
if $K$ stands for KRISHNAGIRI and $D$ for DHARMAPURI
$$P(K| \textrm{RI is on the letter})=\frac{P(\textrm{RI is on the letter}|K)P(K)}{P(\textrm{RI is on the letter})}=\frac{\frac{2}{10}\frac{1}{2}}{\frac{1}{2}\frac{1}{9}+\frac{1}{2}\frac{2}{10}}=\frac{90}{14}\frac{1}{10}=\frac{9}{14} $$
because
$$P(\textrm{RI is on the letter}|K)=2/10$$ as there are 10 pairs of consecutive letters in KRISHNAGIRI, 2 of which are RI, $P(K)=1/2$ as it could've come from either city and 
$$P(\textrm{RI is on the letter})=P(K)P(\textrm{RI is on the letter}|K)+P(D)P(\textrm{RI is on the letter}|D) $$
and $P(\textrm{RI is on the letter}|D)=1/9$ by the same reasoning as before. 
EDIT: as @Especially Lime says, what went wrong is that the two words are of different length, so the probability that the two characters RI survive knowing that all two consecutive characters have equal chance of surviving is different for the two cities, you can verify that if the words had the same length the probability would indeed be $2/3$ 
