We can safely conclude that the robots did not pick $17$ as the first midpoint. They are deterministic and do not like randomness so we can assume they all followed the same scheme. Similarly, it follows that, had they picked the higher midpoint, then they would have always picked the higher midpoint. That means the lower half would split at $17$, $9$, $5$, $3$, $2$. In that case, they would have never chosen $1$ as an answer instead of never choosing $32$. However, they could have solved for any number $[2-32]$. If 50% of the robots go to hell, that means that the devil picked $1$ 50% of the time. This contradicts with what we know based on the peasants' pattern. Therefore, we reject $17$ as the first midpoint.
Now comes the problem: We know the answer is $32$ 50% of the time and we know the answer is somewhere in $[1-5]$ the other 50%. We know the devil chose each with equal probability because of how the peasants were guessing. That means the final answer is $47$.
There are problems in the question's wording: (All have been clarified by OP)
- We're only assuming that each peasant can count to 5 but, based on the wording of what the peasant said, it's more likely that most can't.
We're only assuming that each peasant can count to 5 but, based on the wording of what the peasant said, it's more likely that most can't. - The devil, being not so very nice, could have had a different scheme
for the robots and peasants. There's no reason why, when it's a
peasant, he picks $[1-5]$ 50% of the time and $[6-32]$ 50% of the
time while for a robot he picks $[1-31]$ 50% and $[32]$ 50%. The final answer can be anything between $33$ and $528$.
The devil, being not so very nice, could have had a different scheme for the robots and peasants. There's no reason why, when it's a peasant, he picks $[1-5]$ 50% of the time and $[6-32]$ 50% of the time while for a robot he picks $[1-31]$ 50% and $[32]$ 50%. The final answer can be anything between $33$ and $528$. - If the peasants guess randomly in the set $[1-5]$, then it's possible for the devil to pick, say, $3$ 50% and $32$ 50%. Depending on when they peasants randomly guessed $3$, that gives the 20% / guess result. The final answer can be anything between $33$ and $47$.
If the peasants guess randomly in the set $[1-5]$, then it's possible for the devil to pick, say, $3$ 50% and $32$ 50%. Depending on when they peasants randomly guessed $3$, that gives the 20% / guess result. The final answer can be anything between $33$ and $47$. - The robots could have picked 17 as their midpoint which can shift which number(s) they'll never guess. In that case, the answer can be anything be as low as $19$.
The robots could have picked 17 as their midpoint which can shift which number(s) they'll never guess. In that case, the answer can be anything be as low as $19$. - The peasants can only count to $5$ but that doesn't mean they don't know other numbers exist. It's possible for the devil to pick a number higher than $5$, the peasant randomly guesses $5$ first, the devil says "Higher", and the peasant says, "Uhhh... 14?". The wording only implies that the peasant doesn't know numbers higher than $5$.
The peasants can only count to $5$ but that doesn't mean they don't know other numbers exist. It's possible for the devil to pick a number higher than $5$, the peasant randomly guesses $5$ first, the devil says "Higher", and the peasant says, "Uhhh... 14?". The wording only implies that the peasant doesn't know numbers higher than $5$.