Let X,Y,Z,W be words with vector frequency (x,y,z,w) such that
.
Find certain requirements about x,y,z,w such that W=00,Z=01,Y=10,X=11 is an optimal code.
My solution :
Using Huffman coding, I think the solution is to demand 
The tree is :
In a case that
the next tree is the appropriate tree:
Therefore the optimal code is W=0,Z=10,Y=110,X=111.
The optimal codes for both cases are correct?
Thanks !

