https://i.stack.imgur.com/gb9SD.png
Translation:
Set of two messages m1, m2 is given. Those messages are coded as follows:
C(m1) = 01, C(m2) = 101
Find a probabilities those messages in such a way, that the coding is optimal.
Only a probabilities such that numerator is a whole number and denominator is equal to 2, 4 or 8 are allowed.
I've solved this for sum of probabilities not equal to 1, but I assume that this is not correct. I have not idea hot to solve it for a sum of those probabilities equal to 1 without calculating R for every possibility. Any ideas how to solve it?
This code can’t be optimal, no matter the probabilities. If you have only two messages, the optimal code encodes one as $0$ and the other as $1$.