Let E1:Student resides in the hostel,E2:Student resides outside the hostel,A:Getting A grade in the examination.
P(E1)=40100=25,P(E2)=35,P(A|E1)=50100=12,P(A|E2)=30100=310
By Baye's theorem,P(E1|A)=P(A|E1)P(E1)P(A|E1)P(E1)+P(A|E2)P(E2)=25×1225×12+35×310
∴ P(E1|A)=1019.