Probability for passing a test after n trials suppose I was in lecture 
80% of students came to lectures of a course. If a student came to the lectures, he'd pass a test in 85% and if he didn't came to lectures, he will pass in 50% of time (A student tries doing a test until he passes the first time). Suppose a student passed after n-tests, what is the probability he came to lectures?

If we write the details down defining $A-\text{Student came to lectures} B_i\text{-Student passed ith test}$: $P(A)=0.8,P(B_i\mid A)=0.85,P(B_i\mid A^c)=0.5$ and we need to find $P(A\mid B_n)=\frac{P(A\cap B_n)}{P(B_n)}$. the counter has geometric distribution so so-called it equals $0.15^{n-1}\cdot 0.85$ (n-1 failures and 1 success). The denominator can be expressed as $P(B_n)=P(B_n\cap A)+P(B_n\cap A^c)$. From our details we can say that $P(B_n\cap A)=0.85\cdot 0.8$ and $P(B_n\cap A^c)=0.5\cdot0.2$. It follows $$P(B_i)=0.78\Rightarrow P(B_n\mid A)\frac{0.15^{n-1}\cdot 0.85}{0.78}=1.0897\cdot 0.15^{n-1}$$ Which is incorrect since if we substitute for example $n=1$ we get probability bigger than 1 (and for $n\ge 2$ we just get incorrect probabilities in comparison to bayes law). What am I doing wrong?
 A: I suggest you use Bayes's rule:
\begin{align*}
&\,\mathbb{P}(A\,|\,\text{failed $n-1$ times, passed for the $n$th})\\=&\,\frac{\mathbb{P}(\text{failed $n-1$ times, passed for the $n$th}\,|\,A)\mathbb{P}(A)}{\mathbb{P}(\text{f. $n-1$ times, p. for the $n$th}\,|\,A)\mathbb{P}(A)+\mathbb{P}(\text{f. $n-1$ times, p. for the $n$th}\,|\,A^c)\mathbb{P}(A^c)}\\
=&\,\frac{0.15^{n-1}\times0.85\times0.8}{0.15^{n-1}\times0.85\times0.8+0.5^n\times0.2}\approx\frac{1}{1+0.04412\times3.3333^n},
\end{align*}
assuming that successive results are independent conditional on class participation. (This is probably a strong assumption, though.)
The problem with your approach seems to be that you conceptually mix up joint probabilities and conditional probabilities. The correction intuitive interpretations are as follows:
\begin{align*}
\mathbb{P}(A\cap B)=&\,\text{prob. that}\textbf{ both }\text{$A$}\textbf{ and }\text{$B$ occur,}\\\mathbb{P}(A\,|\,B)=&\,\text{prob. that $A$ occurs} \textbf{ if } \text{$B$ has occurred.}
\end{align*}
These two notions are closely related, but not equivalent!
In particular, $\mathbb{P}(A\cap B_n)$ (using your notation) is not $0.15^{n-1}\times0.85$, but $$\mathbb{P}(A\cap B_n)=\mathbb P(B_n\,|\,A)\mathbb P(A)=0.15^{n-1}\times 0.85\times 0.8.$$ Also, $$\mathbb P(B_n\cap A^c)=\mathbb P(B_n\,|\,A^c)\mathbb P(A^c)=0.5^{n-1}\times0.5\times0.2.$$ With these computations, you'll get the correct result.
