The correct option is B xy1−x−y+2xy
Let K be the event that both of them agree, L be the event that they both speak the truth and M be the event that they both lie.
Probability that both A and B speak the truth = P(L)=xy
Probability that both A and B lie = P(M)=(1−x)(1−y)=1−x−y+xy
We need to find P(LK)
P(LK)=P(L)P(KL)P(L)P(KL)+P(M)P(KM)=xy×1(xy)1+(1−x−y+xy)1=xy1−x−y+2xy