Consider a $2\times 2$ matrix $A$ such that $A_{11}=A_{22}=10$ and $A_{12}=A_{21}=5$. $A_{ij}$ is the number of students getting subject $i$ and code $j$.
We want to select $3$ students according to the following algorithm:
First randomly select a student having subject $1$ and then randomly select a student having subject $2$.
If these two students have the same code, then select a third student randomly who has a different code. Else, select a third student randomly from the remaining students.
What is the probability that under this algorithm, a particular student Alex, who has subject $1$ and code $1$ is selected in our sample?
This is simple, just some computations, where I believe I am messing up. I will show the working, and kindly mention where I am messing up. The answer is supposed to come $0.1$.
So the desired probability is sum of two probabilities: probability that Alex is selected in first time + probability that Alex is selected in third time.
Prob that Alex is selected in first time is $1/15$, since we are selecting one out of $15$ individuals in the first round, i.e. one out of those having subject $1$.
Now to find the prob that Alex is selected in 3rd round, we condition on the event that the earlier two students had the same code (Code 2, as otherwise Alex won't be selected) or different code.
It is to find this prob that I am messing up. I am losing sight of the probability of conditioning event and conditioned event. Any help is appreciated.