Frankly, I don't see how any of this is correct. First off I agree with Lulu, the second problem statement makes no sense without additional details. It's (somewhat) common knowledge that eyewitness testimony is not very reliable. Is this because the eyewitnesses are lying? No, it's because they misremembered or interpreted something incorrectly. So we have to also know what the probability is that they even know what they saw is "true" or "false".
Correction
As for Problem Statement 1: What is the probability of two people telling the truth? is asking a different question.
It's forcing a weird situation that is unintuitive. It's saying an event happened or didn't. So what's the probability that the event happened if the two people agree (even if they agreed it didn't happen!)? This framing is very different from your question, which is if two people agree, are they telling the truth?
end of correction
There is no $p$, the probability of the thing actually being true or not. Let me give you an example, let's say I have a weighted coin that comes up heads 75% of the time and tails 25% of the time. If I flip the coin and it comes up heads, A will say it's heads with $p = x$ and B will say it's heads with $p = y$. The probability of them telling the truth has nothing to do with the probability of the outcome.
Now if I change and say what is the probability that $A$ and $B$ will agree the coin is heads, then yes, the $p$ comes into play (and it's more complicated because now there's a 75% chance it is heads and they both tell the truth or it's tails and they both lie).
So, this is a pretty simple problem, there are four possibilities:
- Both tell the truth: $p = xy$
- Both lie: $p = (1 - x)(1 - y)$
- A lies, B tells truth: $p = (1 - x)y$
- B lies, A tells truth: $p = x(1 - y)$
There are only two cases (1. and 2.) where A and B agree, so this is the "universe" of possibilities. Therefore, if they agree, the probability of them telling the truth is the probability of them both telling the truth divided by the probability that they both agree:
$$
P\left(\text{Truth} | \text{agree}\right) = \frac{xy}{xy + (1- x)(1 - y)}
$$
The above is using the direct definition of a conditional probability (which in my opinion is more appropriate for this problem). It can be tricky to relate this to Baye's Theorem:
$$
P\left(\text{Truth} | \text{agree}\right) = \frac{P\left(\text{agree}|\text{Truth}\right)P\left(\text{Truth}\right)}{P\left(\text{agree}\right)}
$$
The problem is that $P\left(\text{Truth}\right)$ is an abbreviation. It's not the probability that the thing actually happened, it's the probability that they're both telling the truth.
So we know the probability that they both tell the truth: $p = xy$. But what's the probability that they agree if they both tell the truth? Think about that in plain English. If they both tell the truth, they agree, don't they? So $P\left(\text{agree}|\text{Truth}\right) = 1$.
Addressing Comments (which Accumulation already addressed)
Let's look at one specific possible outcome: a red ball is drawn--what is A's response?
He will say, with probability $x$ that a red ball was drawn. What is the probability he'll say not red? Obviously $1 - x$. Now right away, does it matter what the other colors are? What if the other colors are green, blue, yellow, and purple? What is the probability he'll say the drawn ball was brown? There are (more or less) infinite numbers of colors he could say as a lie--a lie isn't bound by what is possible.
But OK, let's say the balls are red, green, blue, yellow, and purple and he always says one of those. What are we told? We're told that he tells the truth with probability $x$. Furthermore, let's say that A's favorite colors are, in this order: purple, yellow, blue, green, and red. So, if A lies, he'll choose his favorite color according to that ranking (probabilistically of course). Let's go through the possibilities:
1. Red Ball is chosen
He either tells the truth ($p = x$) or he says it's purple with $P(purple | lie) = 0.4$, yellow with $P(yellow | lie) = 0.3$, blue with $P(blue|lie) = 0.2$, and green with $P(green|lie) = 0.1$.
2. Green Ball is chosen
He either tells the truth ($p = x$) or he says it's purple with $P(purple | lie) = 0.4$, yellow with $P(yellow | lie) = 0.3$, blue with $P(blue|lie) = 0.2$, and red with $P(red|lie) = 0.1$.
3. Blue Ball is chosen
He either tells the truth ($p = x$) or he says it's purple with $P(purple | lie) = 0.4$, yellow with $P(yellow | lie) = 0.3$, green with $P(green|lie) = 0.2$, and red with $P(red |lie) = 0.1$.
4. Yellow Ball is chosen
He either tells the truth ($p = x$) or he says it's purple with $P(purple | lie) = 0.4$, blue with $P(blue| lie) = 0.3$, green with $P(green |lie) = 0.2$, and red with $P(red|lie) = 0.1$.
5. Purple Ball is chosen
He either tells the truth ($p = x$) or he says it's yellow with $P(yellow | lie) = 0.4$, blue with $P(blue | lie) = 0.3$, green with $P(green |lie) = 0.2$, and red with $P(red|lie) = 0.1$.
You might assert that if he says the ball is red, that there's a $p = x$ chance of him telling the truth (as I initially, erroneously, did) but that's actually wrong (and I show why below).
- Ball is Red: A tells truth: $p = x$
- Ball is Green: A lies, $p = 0.1(1 - x)$
- Ball is Blue: A lies, $p =0.1(1 - x)$
- Ball is Yellow: A lies, $p = 0.1(1 - x)$
- Ball is Purple: A lies, $p = 0.1(1 - x)$
So now the probability of each of these scenarios (red ball, green ball, etc.) is $\frac{1}{5}$ so we have:
\begin{align*}
P(\text{ball is red} | \text{A says it's red}) =&\ \frac{\frac{1}{5}x}{\frac{1}{5}\left(x + 4\cdot 0.1(1 - x)\right)} \\
=&\ \frac{x}{x + 0.4 - 0.4x} \\
=&\ \frac{x}{0.6x + 0.4}
\end{align*}
But this is not the same as "is A telling the truth?". This is only answering the probability that "if A says red, is he telling the truth?" This is very analogous to my initial example where I say there's a difference between "what is the probability that they say heads vs. tails" vs. "what is the probability of lying".
Above I showed that $P(\text{A says R}) = \frac{1}{5}\left(0.6x + 0.4\right)$, likewise we can find the rest:
\begin{align*}
P(\text{A says G}) = \frac{1}{5}\left(x + (0.1 + 3\cdot0.2)(1 - x)\right) =&\ \frac{1}{5}\left(0.3x+ 0.7\right) \\
P(\text{A says B}) = \frac{1}{5}\left(x + (2\cdot0.2 + 2\cdot0.3)(1 - x)\right) =&\ \frac{1}{5} \\
P(\text{A says Y}) = \frac{1}{5}\left(x + (3\cdot0.3 + 0.4)(1 - x)\right) =&\ \frac{1}{5}\left(1.3 - 0.3x\right) \\
P(\text{A says P}) = \frac{1}{5}\left(x + 4\cdot0.4(1 - x)\right) =&\ \frac{1}{5}\left(1.6 - 0.6x\right) \\
\end{align*}
When you add all of these up, you find that the probability is $1$ (i.e. the probability that they pick a color is $1$) as it should be.