Solution to:
The Masters Plaza

Archimedes has a middle rank between Hassan and you.
Then Archimedes has the second, third, or fourth rank.

If Archimedes is in the second rank then Hassan has the first and you have the third rank.
Therefore, Einstein cannot have a higher rank than Archimedes has, so this possibility is false.

If Archimedes has the fourth rank then Hassan and you are in the third and fifth rank,
so Galileo and Einstein have the first and the second rank, which is impossible because they eat on tables next to each other.

If Archimedes has the third rank, and Hassan and you have the second and the fourth rank then Einstein has the first rank and Galileo has the fifth,
because Einstein is more intelligent than Archimedes is, and that is impossible because Einstein is not the head master.

The only true possibility is that Archimedes has the third rank,
Hassan has the first rank and you have the fifth rand,
because you are not the headmaster.
Then Einstein has the second rank and Galileo the fourth,
because Einstein is more intelligent than Archimedes is.

The second step is to list all the possibilities for successive ranks so that they are not next to each other.

Table/room number

1

2

3

4

5

Result

Ranks

1

3

5

2

4

Rejected

1

4

2

5

3

Rejected

2

4

1

3

5

Rejected

2

4

1

5

3

Accepted

2

5

3

1

4

Rejected

3

1

4

2

5

Rejected

3

1

5

2

4

Accepted

3

5

1

4

2

Rejected

3

5

2

4

1

Rejected

4

1

3

5

2

Rejected

4

2

5

1

3

Rejected

4

2

1

3

5

Rejected

5

2

4

1

3

Rejected

5

3

1

4

2

Rejected

Here two possibilities are true as shown in the table but Archimedes (rank 3) does not eat on the fifth table,
so the first possibility is not the table number.
The second possibility is true in table and room numbers case,
but since Hassan does not eat on a table with the same number as his room number,
then the second possibility is for the table number and the first for the room number.
The results are shown in this table: