Let N be the total number of people in the row.
based on given information, we can conclude on following:
We have a row of N people.
Among the first 10 people from the left (positions 1 to 10), 4 are wearing hats.
This implies that 10−4=6 people among the first 10 are not wearing hats.
All people remaining in the row (i.e., from position 11 to N, if N > 10) are wearing hats. This is a crucial point: any person not wearing a hat must be within positions 1 to 10.
Now lets check statement 1:
Statement (1): 5 of the 6 people from the right are wearing hats.
This means 6−5=1 person among the last 6 people in the row is not wearing a hat.
Let the position of this un-hatted person be uhP.
uhP must be in the range [N−5,N].
From above, we know that any person not wearing a hat must be in positions 1 to 10. Therefore, uhP less than or equal to 10.
based on the range and position, we can conclude N−5 <= uhP <=10.
From N−5 <=10, we deduce N<=15.
This statement alone doesn't specify uhP 's exact location, so N could be various values (e.g., if N=15, uhP is at 10. If N=14, uhP is at 9 or 10, etc.).
Thus, statement(1) is not sufficient.
Now lets check statement 2:
Statement (2): 3 of the 8 people from the left are wearing hats.
Among the first 8 people from the left (positions 1 to 8), 3 are wearing hats. This means 8−3=5 people in positions 1-8 are not wearing hats.
Combine this with the initial information (step 3): 6 people in positions 1-10 are not wearing hats.
If 5 non-hat wearers are in 1-8, then 6−5=1 non-hat wearer must be in positions 9 or 10. So, exactly one of the people at position 9 or 10 is not wearing a hat.
This statement alone gives no information about N. Thus, statement (2) is not sufficient.
Now lets combine statement (1) and (2):
From the analysis of both statements, we can conclude that
There are 6 people not wearing hats, all in positions 1-10.
One of these non-hat wearers is at position 9 or 10.
The other five non-hat wearers are in positions 1-8.
The single non-hat wearer among the last 6 people, uhP must be at a position less than or equal to 10.
If uhP is one of the five non-hat wearers in positions 1-8, then the non-hat wearer at position 9 or 10 would be outside the group of the last 6 people (meaning it would have to be <N−5). This would imply 9<N−5, or N>14. But since uhP <=8, we also have N−5<=8, or N<=13. These conditions (N>14 and N<=13) are contradictory, so this case is impossible.
Therefore, uhP must be the single non-hat wearer from positions 9 or 10.
This means the un-hatted person from the right is either at position 9 or 10.
N−5<=uhP
If uhP =9: N−5<=9 --->N<=14. In this case, the 5 non-hat wearers in 1-8 must be less than N−5=9. This is consistent. N=14 is a possibility.
If uhP =10: N−5<=10 --->N<=15. In this case, the 5 non-hat wearers in 1-8 must be less than N−5=10. This is consistent. N=15 is a possibility.
Since N can be 14 or 15, the information is not sufficient to determine the exact number of people in the row.