You want to pick A twice and B eight times, so the probability of doing this in a certain order is $P(A)^2P(B)^8$. But for you, the order doesn't matter, so you have to divide by the number of ways to choose two things from 10. This is $\binom{10}{2}=\frac{10!}{8!2!}=45$. So all in all you get $\frac{(45)3^8}{4^{10}}$, which you can calculate yourself.
In general the formula for $\binom{n}{r}=\frac{n!}{(n-r)!r!}$, where the exclamation point means "factorial," $n!=n\times(n-1)\times\dotsb\times 2\times 1$. Since $n!$ represents the number of arrangements of $n$ things, you can interpret this formula as giving you the number of arrangements of your $n$ things, and then cancelling out the ways you can arrange the $r$ things you want, and the $n-r$ things you don't want.