KR: Exercise 3

Probabilistic Reasoning with Answer Sets

Rock, paper, scissors, lizard, Spock


In an episode of "Big Bang Theory", Kooth Rapali suggets Sheldon Cooper to play Rock, Paper, Scissors but Sheldon complains about the high probability of tying so he suggests playing Rock-paper-scissors-lizard-Spock with the following rules:
  • Scissors cut paper
  • Paper covers rock
  • Rock crushes lizard
  • Lizard poisons Spock
  • Spock smashes scissors
  • Scissors decapitate lizard
  • Lizard eats paper
  • Paper disproves Spock
  • Spock vaporizes rock
  • Rock crushes scissors
We suppose that each of them selects one sign in a completely random way, equally probable for the five cases.

What to do

Model the scenario in P-log so that we can conclude any of the facts, winner(kooth), winner(sheldon) or tie, according to the game result. Then, compute with P-log the following probabilites
  • The probability of winner(kooth).
  • The probability of winner(kooth) conditioned to the observation play(sheldon)=rock.
  • The probability of a  tie.
  • The probability that someone marks scissors.

Now suppose that Kooth is sometimes quick enough to see Sheldon making the "paper" sign. In fact, 2 of each 3 times, she is able to foresee Sheldon's "paper". In that case, Kooth always marks "scissors". Model this variant anfourd recompute the  probabilities above in this new situation.

You must deliver three files: two files with the domains in P-log (the original one and the second variant) plus a text file listing the obtained results (and, if possible, explaining their values).

Installing and using P-log

For installing P-log you will need lparse and smodels which are analogous tools to gringo and clasp, respectively. To this aim, follow these instructions

  1. Download lparse and smodels
  2. Compile both tools and place the resulting binaries in some directory in your path. (You will need bison/yacc if not installed)
  3. Download plog and compile the source with cmake

Finally, for executing plog, type

     plog -t filename.txt

You can try the following examples included in the slides: jungle.txt, montyhall.txt, simpson.txt

Assessment & delivery

The maximum grade for this exercise is 0,5 points. The deadline for delivery is May 30th, 2014 using the lab work mailbox or buzón de prácticas.

Maintained by Pedro Cabalar. Last update May. 7th 2014