Exit poll in elections 
We want to run an exit poll for the government referendum, by asking the voters in one vote center whether they voted for option A or B.
  We have an urn with 5 red, 3 green and 2 blue marbles. Each voter randomly picks one marble from the urn, sees its color and then places it back in the urn. If it is red, he tells the truth (we assume that he must have voted either A or B – there is no other option). If it is green, he replies “B”, regardless of what he has actually voted and if it is blue, he replies “A”, again regardless of what he has actually voted. 
  At the end of the exit poll, we got 40% A’s. What is the actual percentage of the A’s voters in this vote center?  

Probabilities is not my strong area of knowledge :(
I was told that this is an easy example of Bayes theorem - I went through it but really can't find how to apply it!
\begin{align}
\mathsf P(R\mid G, B) & = \frac{\mathsf P(R,G,B)}{\mathsf P(G, B)}
\end{align}
OK of course the probability of R is 0.5, of G 0.333 and for B 0.2. 
But I don't know what to do then. 
 A: A voter votes, picks a ball and based on the color of the ball and the rule in place says "A" or "B". What is the probability that the voter will say "A" in the end? The voter will eventually say "A" in two cases only:


*

*He really voted for option A and picked the red ball forcing him to tell the truth

*...or the voter picked the blue ball that forces him to say "A" 


Translated to probabilities:
$$p(\text{voter says "A" in the end})= \\
p(\text{voter voted for option A})\times p(\text{voter picked the red ball})+p(\text{voter picked the blue ball})$$ 
...or with the numbers that you have:
$$p(\text{voter says "A" in the end})= 
p(\text{voter voted for option A})\times \frac{5}{10}+\frac{2}{10}\tag{1}$$
We also know (based on our exit poll) that:
$$p(\text{voter says "A" in the end})=40\%=0.4$$
Replace that into (1) and you get:
$$0.4= p(\text{voter voted for option A})\times 0.5+0.2\tag{1}$$
$$p(\text{voter voted for option A})=0.4=40\%$$
Turns out to be the same, but that's just a lucky coincidence.
A: Suppose there are $1000$ voters, $10a$ vote for $A$ and $10b$ for $B$. 
Also let it be that $5a$ of the $A$-voters picks a red marble, $3a$ a green marble and $2a$ a blue marble.
Similarly $5b$ of the $B$-voters picks a red marble, $3b$ a green marble and $2b$ a blue marble.
Then in total $7a+2b$ will say to have voted for $A$, so we have the equalities:


*

*$a+b=100$

*$7a+2b=400$
leading to $a=40$, i.e. $40\%$ voters for $A$.
