Possible max matchings our children (J/K/L/M) each wants a piece of fruit. There are five pieces of fruit available: an apple, a banana, a nectarine, an orange and a pear.
J likes bananas and nectarines.
K likes apples, nectarines, oranges and pears.
L likes apples and bananas.
M likes oranges and pears.
How many possible maximal matching are there?
Options: 4/5/3/2
Found something similar posted but still a bit confused:
http://stackoverflow.com/questions/26250446/maximum-matching-for-assigning-2-items

 A: Suppose we assign a number to the fruit  based on alphabetical order. (this is just to save space and time, it's not really needed to solve it).
Apple = 1 ; Banana = 2 ; Nectarine = 3 ; Orange = 4 ; Pear = 5
In the end it's about writing four digits numbers assuming that J is the thousand, K the hundred, L the tens and M the units.
Thousands can be only 2 or 3.
Hundreds can be 1,3,4 or 5.
Tens can be only 1 or 2.
Units can be only 4 or 5.
Digits cannot be repeated.
(Example: 2314 means J gets banana, K gets Nectarine, L gets apple and M gets orange)
2314, 2315, 2415, 2514, 3124, 3125, 3415, 3425, 3514, 3524.
That's it. There's a total of 10 maximal matching.
EDIT
Here is an algorithm with Maple to find out the number of matching and the matching themselves.
N := 0:
for J from 2 to 3 do
    for K from 1 to 5 do
        if not(K=J) and not(K=2) then
        for L from 1 to 2 do
           if not(L=J) and not(L=K) then
           for M from 4 to 5 do
               if not(M=K) then
                   N := N + 1;
               end if;
           end do;
           end if;
        end do;
        end if;
    end do;
end do;
'total' = N;
V := Vector(N):
X := 0:
for J from 2 to 3 do
    for K from 1 to 5 do
        if not(K=J) and not(K=2) then
        for L from 1 to 2 do
           if not(L=J) and not(L=K) then
           for M from 4 to 5 do
               if not(M=K) then
                   X := X + 1;
                   V[X] := J * 1000 + K * 100 + L* 10 + M;
               end if;
           end do;
           end if;
        end do;
        end if;
    end do;
end do;
'matching' = V;
