 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  Quiz Quandary III (Posted on 2014-07-15) In a certain island, one-third of the native people are liars who always lie, one-third are knights who always tell the truth, and one-third are knaves that is, people who strictly alternate between speaking the truth and telling a lie, irrespective of order. The chances of encountering any one of the three natives on a road on the island are the same.

Four friends Art, Ben, Cal and Dan – who are natives of this island got the top four ranks in a certain quiz The following statements are made by each of Art, Ben, Cal and Dan.

Art
1. Exactly two of us are knights.
2. Ben got the first rank and Cal got the third rank.

Ben
1. Dan got the fourth rank.
2. Exactly one of us is a knave.

Cal
1. The absolute difference between Ben's rank and mine is 2.
2. Dan is not a liar.

Dan
1. Exactly one of us is a liar.
2. I am a knave.

Assuming no ties, determine the probability that:

(i) The absolute difference between Cal's rank and Dan’s rank is 1.
(ii) Exactly three of the four friends are liars.
(iii) Exactly two of the four friends are knaves.
(iv) At least one of the four friends is a knight.

*** For Art’s second statement - assume the entire statement is a lie if the whole statement or any of its parts thereof is false. For example- A2 is false if in reality Ben got the first rank and Cal got the fourth rank.

 No Solution Yet Submitted by K Sengupta Rating: 3.5000 (2 votes) Comments: ( Back to comment list | You must be logged in to post comments.) ignore previous post: solution correced Comment 8 of 8 | The Baysian division has now been applied:

DefDbl A-Z
Dim crlf\$, types\$
Function mform\$(x, t\$)
a\$ = Format\$(x, t\$)
If Len(a\$) < Len(t\$) Then a\$ = Space\$(Len(t\$) - Len(a\$)) & a\$
mform\$ = a\$
End Function

ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
Text1.Text = ""
crlf\$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents
types\$ = "0123" ' liar,second is truth,first is truth, knight
places\$ = "abcd": h\$ = places\$
Do

For a = 0 To 3
a1 = a \ 2: a2 = a Mod 2
For b = 0 To 3
b1 = b \ 2: b2 = b Mod 2
For c = 0 To 3
c1 = c \ 2: c2 = c Mod 2
For d = 0 To 3
d1 = d \ 2: d2 = d Mod 2

ktct = Abs((a = 3) + (b = 3) + (c = 3) + (d = 3))
kvct = Abs((a = 1 Or a = 2) + (b = 1 Or b = 2) + (c = 1 Or c = 2) + (d = 1 Or d = 2))
ctgno = 1
For i = 1 To kvct
ctgno = ctgno / 2
Next
situations = situations + ctgno
If Abs(ktct = 2) = a1 And Abs(Mid(places\$, 1, 1) = "b" And Mid(places\$, 3, 1) = "c") = a2 Then
If Abs(Mid(places\$, 4, 1) = "d") = b1 Then
If Abs(kvct = 1) = b2 Then
br = InStr(places\$, "b")
cr = InStr(places\$, "c")
If Abs(Abs(cr - br) = 2) = c1 And Abs(d <> 0) = c2 Then
lct = Abs((a = 0) + (b = 0) + (c = 0) + (d = 0))
If Abs(lct = 1) = d1 And Abs(d = 1 Or d = 2) = d2 Then
Text1.Text = Text1.Text & a & b & c & d & "   " & places\$ & crlf
dr = InStr(places\$, "d")
If Abs(cr - dr) = 1 Then pt1ct = pt1ct + ctgno
If lct = 3 Then pt2ct = pt2ct + ctgno
If kvct = 2 Then pt3ct = pt3ct + ctgno
If ktct > 0 Then pt4ct = pt4ct + ctgno
observedct = observedct + ctgno
DoEvents
End If
End If
End If
End If
End If
Next d
Next c
Next b
Next a
permute places\$
Loop Until places\$ = h\$
Text1.Text = Text1.Text & crlf & mform(pt1ct, "##0.0000") & mform(situations, "#####0") & mform(pt1ct / situations, "#0.000000") & mform(pt1ct / observedct, "#0.000000") & crlf
Text1.Text = Text1.Text & mform(pt2ct, "##0.0000") & mform(situations, "#####0") & mform(pt2ct / situations, "#0.000000") & mform(pt2ct / observedct, "#0.000000") & crlf
Text1.Text = Text1.Text & mform(pt3ct, "##0.0000") & mform(situations, "#####0") & mform(pt3ct / situations, "#0.000000") & mform(pt3ct / observedct, "#0.000000") & crlf
Text1.Text = Text1.Text & mform(pt4ct, "##0.0000") & mform(situations, "#####0") & mform(pt4ct / situations, "#0.000000") & mform(pt4ct / observedct, "#0.000000") & crlf
Text1.Text = Text1.Text & observedct & "  " & situations & crlf & "done"
End Sub

finds

`ABCD   order0000   adbc0011   adbc0100   adbc0000   adcb0011   adcb0100   adcb1231   bacd3231   bacd0000   badc0011   badc0100   badc0000   bcda0011   bcda0100   bcda0000   bdac0011   bdac0100   bdac1020   bdca0220   cabd0320   cabd0000   cadb0011   cadb0100   cadb0000   cbda0011   cbda0100   cbda0000   cdab0011   cdab0100   cdab0000   dabc0011   dabc0100   dabc0000   dacb0011   dacb0100   dacb0000   dbca0011   dbca0100   dbca0000   dcba0011   dcba0100   dcba  9.3750  1944 0.004823 0.418994  6.0000  1944 0.003086 0.268156  3.7500  1944 0.001929 0.167598  0.8750  1944 0.000450 0.03910622.375  1944`

which shows, in the first 41 lines, the possibilities. They are not all equally probable, as:

0 represents liar: truth value for two statements 00.
1 represents knave: truth value for two statements 01, in that order.
2 represents knave: truth value for two statements 10, in that order.
3 represents knightr: truth value for two statements 11.

The two knave situations count for only 1/3 of possibilities, so only half of a unit counts for a situation having one knave; only 1/4 for a situation having two knaves, etc.  These situations add up to the correct 1944, which is 3^4 * 4!, that they would be if the order of the statements didn't matter.

The overall situations (weighted) add to only 22.375 so the a priori probability of encountering this set of statements would be 22.375 / 1944.

With these weights, the probability for part (i) is 9.375/22.375, for part (ii) is 6/22.375, for (iii), 3.75/22.375 and for part (iv), .875/22.375.  Decimal values are shown in the last column above. The next-to-last column represents only the probability that the situation would be as described AND that the requested condition within that be the case. The final column is the result modified by the Baysian condition that we already know the given statements were in fact made.

 Posted by Charlie on 2014-07-17 13:14:29 Please log in:

 Search: Search body:
Forums (0)