Let $E_1$: students residing in the hostel $\rightarrow$ P($E_1$) = 60% = $\large\frac{60}{100} = \frac{3}{5}$
Let $E_2$: day scholars $\rightarrow$ P($E_2$) = 40% = $\large\frac{40}{100} = \frac{2}{5}$
30% of hostel students get an A grade $\rightarrow$ P (E|$E_1$) = 30% = $\large\frac{30}{100} = \frac{3}{10}$
20% of day scholars get an A grade $\rightarrow$ P (E|$E_2$) = 20% = $\large\frac{20}{100} = \frac{1}{5}$
We need to find the probability that a student who is chosen from random that has an A grade is from the hostel.
We can use Baye's theorem, according to which $P(E_1|A) = \large\frac{P(E_1)(P(A|E_1)}{P(E_1)P(A|E_1) + P(E_2)+P(A|E_2)}$
Using Baye's theorem, P ($E_1$|A) =$ \Large\frac{\frac{3}{5}.\frac{3}{10}}{\frac{3}{5}.\frac{3}{10}+\frac{2}{5}.\frac{1}{5}}$ = $\large\frac{9}{9+4} = \frac{9}{13}$