Your friend tosses three coins and you roll a single die. If the number on the die you roll is less than or equal to the number of heads that your friend tosses, you win $X. If not, you lose $1. How large should X be in order for this to be a fair game?

If your friend throws 3 heads (for which the probability is 1/8), you win $X if you toss 1,2, or 3 (probability 1/2)and you lose $1 if you toss 4,5, or 6 (probability 1/2).

For these cases the expected winning amount is X/16 - 1/16.
If your friend tosses 2 heads (for which the probability is 3/8) you win $X if you toss 1 or 2 (probability 1/3) and lose $1 if you toss 3,4,5 or 6 (probability 2/3).
Expected winning: X/8 - 1/4
If your friend tosses 1 head (for which the probability is 3/8, you win $X if you toss 1 (probability 1/6) and lose $1 is you toss 2,3,4,5 or 6 (probability 5/6). The expected winning is X/16 - 15/48
If you friend tosses no heads (for which the probability is 1/8, you are sure to lose $1. The expected winning is -1/8.
Net expected winning =
X/16 -1/16 +X/8 -1/4 +X/16 -15/48 -1/8
= X/4 - 36/48 = X/4 - 3/4
You will probably break even if X = $3 If X>3 you will probably win money.