When planning a party you want to know whom to invite. Among the people you would like to invite are three touchy friends. You know that if Jasmine attends, she will become unhappy if Samir is there, Samir will attend only if Kanti will be there, and Kanti will not attend unless Jasmine also does. Which combinations of these three friends can you invite so as not to make someone unhappy?
Let J, S, K mean we can invite Jasmine, Samir, and Kanti , in that order.
According to the problem,
1) You know that if Jasmine attends, she will become unhappy if Samir is there
2) Samir will attend only if Kanti will be there, and
3) Kanti will not attend unless Jasmine also does.
To fulfill the conditions (not to make someone unhappy), the three can be rewritten to:
1) S -> !J
2) S -> K
3) K -> J
Let's consider the conditions, one case at a time (0 = false, 1 = true):
J S K
0 0 0
0 0 1 -- fails 3
0 1 0 -- fails 2
0 1 1 -- fails 3
1 0 0
1 0 1
1 1 0 -- fails 1, 2
1 1 1 -- fails 1
This leaves us with only 3 possible choices:
invite only Jasmine,
invite both Jasmine and Kanti , or
invite no one at all.
Comments
Leave a comment