one example on naive bayes? I see one example on my class notes, but couldn't progress how this reached:

Update: the prior probability of two class is assumed to be equal.
is there any way to calculate this by hands?
 A: According to Bayes formula, $$P(B| (X,Y)=(3,1))=\frac{P((X,Y)=(3,1)|B)P(B)}{P((X,Y)=(3,1))}$$
$P(B)$ is $4/7$ based on number of examples in each class. And, we’ll apply the Naive assumption, i.e. conditional independence, on features given class as follows:
$$P((X,Y)=(3,1)|B) =P(X=3|B)P(Y=1|B)=1/4\times1/2=1/8$$
So, the numerator is 1/14, which is equal to the given answer. But, this is not normalized, so it is not the probability of this sample belonging to class B. However, typically, in Naive Bayes, we only calculate the numerator and decide the class which maximizes it.
Normally, you need to calculate the denominator for a probability, and there you’ll apply total law of probability:
$$P((X,Y)=(3,1)) = P((X,Y)=(3,1)|B)P(B) + P((X,Y)=(3,1)|A)P(A) $$
Here, we proceed similarly for class A. $P(A)=3/7$ and $$P((X,Y)=(3,1)|A)=P(X=3|A)P(Y=1|A)=1/3\times1/3=1/9$$
So,
$$P((X,Y)=(3,1))=1/14+1/9\times3/7=1/14+1/21=5/42$$
When we substitute into the original Bayes formula, we have
$$P(B| (X,Y)=(3,1))=\frac{1/14}{5/42}=3/5$$
Edit: If priors P(A) and P(B) are given as equal and not estimated from the data, i.e. they're both 1/2, we'll just substitute 1/2 for them (i.e. P(A) and P(B)) in the above equations, the probability we're interested in is
$$p=\frac{1/8\times1/2}{1/8\times1/2+1/9\times1/2}=9/17$$
