Starting from:

$24.99

CS7642 Homework #5- Bar Brawl Solution


Problem
Description
You are the proprietor of an establishment that sells beverages of an unspecified, but delicious, nature. The establishment is frequented by a set P of patrons. One of patron is the instigator and another is the peacemaker.

On a given evening, a subset S ⊆ P is present at the establishment. If the instigator is in S but the peacemaker is not in S, then a fight will break out. If the instigator is not in S or if the peacemaker is in S, then no fight will occur.

Your goal is to predict whether a fight will break out among a subset of the patrons without initially knowing the identity of the instigator or the peacemaker.
Procedure
Develop a KWIK learner for this problem. When presented with S, the patrons at the establishment, your learner will respond with "FIGHT", "NO FIGHT", or "I DON'T KNOW". Additionally, it should be capable of learning from the tuple of S and the true outcome for the evening.
For each problem, the following input will be given: atEstablishment : boolean[0..numberOfEpisodes][0..numberOfPatrons] fightOccured : boolean[0..numberOfEpisodes]

Specifically:
● For each episode, you should present your learner with the next row of atEstablishment and the corresponding row of fightOccured.
● If your learner returns “I DON’T KNOW”, then you should present the pair (atEstablishment, fightOccured) to you learner to learn from.

You will submit a list of strings of the output of from you learner each time it is presented with an episode.

Example
The test case will be considered successful if no wrong answers are returned and number of "I
DON'T KNOW" does not exceed the max allowed.
boolean[][] atEstablishment = {
{true,true},
{true,false},
{false,true},
{true,true},
{false,false},
{true,false},
{true,true}
};
boolean[] fightOccurred = {
false, true, false, false, false, true, false
};

Output: No incorrect answers and only 1 “I DON’T KNOW”
0, -1, 0, 0, 0, 1, 0

KEY for output

0 = NO FIGHT
-1 = I DON’T KNOW
1 = FIGHT

Resources
The concepts explored in this homework are covered by:
● Readings
○ Li, Littman, Walsh (2008)
Submission Details
To complete assignment calculate answers to the specific values given and submit results at https://rldm.herokuapp.com

More products