Four people are standing in a line, each facing forwards. They are not allowed to move, turn their heads or speak (except to give the answer). The fourth is behind a partition wall and can neither see nor be seen by the other candidates. Each is wearing a backpack of unknown colour which they can’t see (and are not allowed to take off), but all know that two backpacks are blue and two brown. If any one of the people can tell the colour of your backpack, they can leave.

Does any candidate answer, and if so, which one? Why?

It depends on where you are. If you are in front, the two behind you know what you have on.

Clearly the person in front and the person behind the wall know nothing

So it is left to either the second or third person.

If the third person sees two identical colours in front of him, either both blue or both brown, then he knows his is the opposite, he will announce his colour and they all can leave.

If the third person says nothing then the second person knows that his is different from the colour of the pack in front of him. He can then announce his colour as opposite to the one he sees in front of him and they can all leave.

Determined wheter the following equations have a solution or not5X^2+8X+7=0

The colored hats problem comes in many varieties. This one is the closest to the one you posed and should enable you to solve your specific problem.

Alan, Ben, and Cal are seated in a room with blindfolds on. They are seated one behind the other with Ben in front of Alan, and Cal in front of Ben. Three hats are placed on their heads from a box they know contains 3 red and 2 blue hats. They are told to remove their blindfolds, one at a time, and, based soley on what they can see in front of them, try to determine what color hat they have on their heads.

They open their eyes one at a time, starting with Alan, and look forward only. After some time, Alan says, "I cannot deduce what color hat I'm wearing." Hearing that, Ben removes his blindform and, after a similar period of time, says, "I cannot deduce what color I'm wearing, either," After removing his blindfold, Cal immediately says, "I know what color I'm wearing!" How does Cal know what color his hat is?

The problem appears with different colored hats, usually with 3 red hats and 2 black or blue hats. Using the 3 reds and 2 blues:

Lets call the people 1, 2, and 3.
Assuming that each person was equally smart, they each realized that there were only 7 possible ways of adorning their heads with the 3 red and 2 blue hats. They were:
.....................Cand. # 1 2 3
1- R R R
2- R R B X2
3- R B R
4- R B B X1
5- B R R
6- B R B X2
7- B B R
As you state, #1, or Alan, opts not to answer as he cannot tell what his hat color is. Why not? Well, if he had seen 2 blue hats on #2 and #3, he would have immediately known that his hat had to be red. Since he does not answer, he must be seeing either 2 red hats or 1 blue and 1 red hat, eliminating combination #4, and thus having no way of determining the color of his hat.
#2, or Ben, being just as smart as #1, realizes that since #1 did not answer, #1 must be seeing either 2 red hats or 1 blue hat and 1 red hat. Therefore, if #2 sees a blue hat on #3, he knows immediately that his hat must be red. Alas, since he also opts not to reply, he must not see a blue hat on #3 and must be seeing a red hat, eliminating combinations 2 and 6.
#3, Cal, being just as smart as the other two, and not even seeing the other hats, realized that the only other possible combinations of hat distribution, place a red hat on #3, so it was rather easy for him to conclude that his hat was red without seeing any of the others.

TO ANONYMUS

Determined wheter the following equations have a solution or not5X^2+8X+7=0
if you intend 5(x^2)+8x+7=0 then no.
subtract 7 and 8x from both sides.
5(x^2) = -7-8x divide both sides by 5
x^2 = (-7-8x)/5
RULE. x^2 ( X squared ) is always positive. Like 2*2 (=4) or -5*-5 (=25)

In this scenario, the third candidate will be able to answer the question correctly. Here's an explanation of why:

First, let's consider the possibilities for the backpack colors:

1. If the first two candidates have backpacks of the same color (either blue or brown), the third candidate will be able to determine their own backpack color immediately. This is because if the first two candidates have the same color, the remaining two colors will be used for the third and fourth candidates.

2. If the first two candidates have backpacks of different colors (one blue and one brown), the third candidate will still be able to determine their own backpack color. This is because the fourth candidate, who is behind the partition and cannot see anyone, also knows that two backpacks are blue and two are brown. Therefore, if the third candidate sees two backpacks of the same color (either blue or brown) in front of them, they will know that their own backpack color must be different.

In both cases, the third candidate will be able to give the correct answer and leave, as they can deduce the color of their own backpack based on the information available to them.