Secret Sharing 1 Required Devise a scheme so that a message M can be shared among X, Y and Z in such a say that the only way of recovering the message is when X is present with either Y or Z. When X isn't present or each is alone, they will not be able to recover the shared secret.

Additionally, generalize the above to devise a scheme so that a M can be shared among 5 entities such that the only way of recovering the secret is when either X and Y are both present or when C, D, E are all present together.

I have no idea how to create a hierarchy such as what is being proposed. Any ideas?
This is actually a fairly trivial case of secret sharing:

In the first case, we select a random value $R$, we give $X$ the value $R \oplus M$, and we give both Y and Z the value $R$.  Obviously, $X$ alone, nor $Y$ and $Z$ together cannot reconstruct $R$.

In the second case, we select random values $R_1$, $R_2$ and $R_3$, we give:


$R_1 \oplus M$ to $X$
$R_1$ to $Y$
$R_2 \oplus R_3 \oplus M$ to $C$
$R_2$ to $D$
$R_3$ to $E$


Shamir Secret Sharing is a neat trick; however sometimes problems can be solved by simpler methods.