Author 
Message 
Reef Fish science forum Guru Wannabe
Joined: 28 Apr 2005
Posts: 200

Posted: Thu Jun 09, 2005 8:23 pm Post subject:
Re: Probability question, was Re: Mensa Forgot Another Possibility!



Scott Hemphill wrote:
Quote:  "Mark" <Markiehatesspam@notelespam2.fr> writes:
"BruceS" <bruces42@hotmail.com> wrote in message
news:1118264621.238754.254340@f14g2000cwb.googlegroups.com...
I wouldn't be at all offended if you reposted there and returned here
with any answers. I try to avoid crossposting, especially to groups I
don't follow.
Here then is the question as I remember it:
on consideration this may not be precisely on topic for sci.stat.math
although I suppose that in general people who are up on stats are up on
probability too.
A student sits a test that has 20 questions; every question has precisely 1
matching answer. There are 20 answers, no duplication. The student answers
every question with a different answer from the 20.
What is the probability, of a student answering randomly, answering
precisely 1 right? precisely 10 right?
This problem is treated in _Concrete Mathematics_ by Graham, Knuth and
Patashnik. They call it the "'football victory problem': a group of n fans
of the winning football team throw their hats high into the air. The
hats come back randomly, one hat to each of the n fans. How many ways
h(n,k) are there for exactly k fans to get their own hats back?"
They derive a closed form solution for the answer:
h(n,k) = choose(n,k) * subfactorial(nk)
where choose(n,k) = nCk = n!/((nk)!k!)
and subfactorial(n) is the number of derangements of n objects, i.e.
the number of permutations for which none of objects are in their
original position.
subfactorial(n) is further developed:
subfactorial(n) = round(n!/e) + [n==0]
where round is the function which rounds to the nearest integer
and the bracket notation yields 1 if the boolean expression inside
is true and 0 if the boolean expression is false. I've used ==
for the equality operator, and e is Euler's constant e = 2.71828....

All things aside, why are you calling e = exp(1) Euler's constant?
Euler's constant is the limit (as n goes to infinity) of
1 + 1/2 + 1/3 + 1/4 + 1/5 + ... + 1/n  log n.
=0.57721566 4901532860 6065120900 8240243104 2159335939 9235988057 ...
The other numerical values and statements are correctl.
 Bob.
Quote: 
The values of h(n,k) for n = 20:
k h(20,k)
 
0 895014631192902121
1 895014631192902120
2 447507315596451070
3 149169105198816960
4 37292276299704525
5 7458455259939936
6 1243075876659240
7 177582268088640
8 22197783520770
9 2466420377200
10 246642054516
11 22421988160
12 1868513010
13 143722080
14 10271400
15 682176
16 43605
17 2280
18 190
19 0
20 1
The exact probability of each "k" occurring is calculated by dividing each
of these values by 20!.
Scott

Scott Hemphill hemphill@alumni.caltech.edu
"This isn't flying. This is falling, with style."  Buzz Lightyear 


Back to top 


alan truelove science forum beginner
Joined: 09 Jun 2005
Posts: 8

Posted: Thu Jun 09, 2005 8:32 pm Post subject:
Re: Probability question



From rec.org.mensa
anyone got a slicker solution ??
'            
On Thu, 9 Jun 2005 13:56:11 +0200, "Mark"
<Markiehatesspam@notelespam2.fr> wrote:
Quote:  "BruceS" <bruces42@hotmail.com> wrote in message
news:1118264621.238754.254340@f14g2000cwb.googlegroups.com...
I wouldn't be at all offended if you reposted there and returned here
with any answers. I try to avoid crossposting, especially to groups I
don't follow.
Here then is the question as I remember it:
on consideration this may not be precisely on topic for sci.stat.math
although I suppose that in general people who are up on stats are up on
probability too.
A student sits a test that has 20 questions; every question has precisely 1
matching answer. There are 20 answers, no duplication. The student answers
every question with a different answer from the 20.
What is the probability, of a student answering randomly, answering
precisely 1 right? precisely 10 right?
Mark
'    
Getting 1 right: 0.3679
Getting 10 right: 0.01378 * 10^(7)
'   
P(n,x) is prob getting x right out of n
Q(n,y) is prob of getting y right, with n 'good' questions plus one
'dummy' question (cannot be matched),
and n good answers plus one dummy answer (cannot be matched)
P(n,x) = P(n1,x1)/n + (n1)*Q(n2,x)/n
Q(n,y)=P(n,y)/(n+1) + n*Q(n1,y)/(n1)
P(n,n)=1/n!
P(n,n1)=0
'  
VB.net  form1 has one button, Button1
'   
Form1:
Imports System.Math
Public Class Form1
Inherits System.Windows.Forms.Form
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim i, j, iii, jjj, ii, jj As Integer
ReDim P(100, 100)
ReDim Q(100, 100)
P(1, 1) = 1
P(1, 0) = 0
Q(1, 1) = 0.5
Q(1, 0) = 0.5
Q(0, 0) = 1
'      
For n = 2 To 20
P(n, n) = 1
For jj = 2 To n
P(n, n) = P(n, n) * jj
Next
P(n, n) = 1 / P(n, n)
'  
P(n, n  1) = 0
pstr = n & " p " & P(n, n) & " " & P(n, n  1) & " "
For x = n  1 To 0 Step 1
' if we got a hit on first try
If x < n  1 Then
P(n, x) = 0
If (x > 0) Then P(n, x) = P(n  1, x  1) / n
If n > 1 Then P(n, x) = P(n, x) + _
(n  1) * Q(n  2, x) / n '(n1)/n is the prob of
no hit
' Q(n2,x) is prob  with n2 questions and 1
dummy 
' we match correctly to x out of n1 answers plus
one dummy
' the answer dummy comes because we just used up
the right question for it,
' and the question dummy comes because we have knocked
out the right answer to it
pstr = pstr & " " & P(n, x)
End If
Next
If n = 20 Then MsgBox(pstr)
'   
For y = n To 0 Step 1
Q(n, y) = P(n, y) / (n + 1)
If n > 1 Then Q(n, y) = Q(n, y) + n * Q(n  1, y) / (n
+ 1)
'if we do match 'on the first dummy question  try,
prob 1/(N+1), then we are left with
' n good questions and n good answers
'n/(n+1) is the prob of not matching dummies
' if we dont match, then we have lost the question
dummy, but another has been created
' it doesnt have a correct answer anywhere
' so we are at n1 questions + 1 dummy
'we have knocked out a good answer (for the new dummy
question) so we have n1 answers
' plus the original dummy
Next
Next
End
End Sub
End Class
'        
Module global
Public Q(,), P(,) As Single
Public n, x, y As Integer
Public pstr As String
End Module
> 

Back to top 


Scott Hemphill science forum beginner
Joined: 09 Jun 2005
Posts: 21

Posted: Fri Jun 10, 2005 12:34 am Post subject:
Re: Probability question, was Re: Mensa Forgot Another Possibility!



"Reef Fish" <Large_Nassau_Grouper@Yahoo.com> writes:
Quote:  Scott Hemphill wrote:
where round is the function which rounds to the nearest integer
and the bracket notation yields 1 if the boolean expression inside
is true and 0 if the boolean expression is false. I've used ==
for the equality operator, and e is Euler's constant e = 2.71828....
All things aside, why are you calling e = exp(1) Euler's constant?

A mental lapse. I stand corrected.
Quote:  Euler's constant is the limit (as n goes to infinity) of
1 + 1/2 + 1/3 + 1/4 + 1/5 + ... + 1/n  log n.
=0.57721566 4901532860 6065120900 8240243104 2159335939 9235988057 ...

Yes, I am familiar with this constant.
Scott

Scott Hemphill hemphill@alumni.caltech.edu
"This isn't flying. This is falling, with style."  Buzz Lightyear 

Back to top 


alan truelove science forum beginner
Joined: 09 Jun 2005
Posts: 8

Posted: Fri Jun 10, 2005 2:38 pm Post subject:
Re: Probability question



Q(n,y)=P(n,y)/(n+1) + n*Q(n1,y)/(n1)
should be
Q(n,y)=P(n,y)/(n+1) + n*Q(n1,y)/(n+1) 
the code is correct 

Back to top 


Martin Evans science forum beginner
Joined: 10 Jun 2005
Posts: 3

Posted: Fri Jun 10, 2005 2:54 pm Post subject:
Re: Probability question



alan truelove wrote:
Quote:  From rec.org.mensa
anyone got a slicker solution ??
'            
A student sits a test that has 20 questions; every question has precisely 1
matching answer. There are 20 answers, no duplication. The student answers
every question with a different answer from the 20.
What is the probability, of a student answering randomly, answering
precisely 1 right? precisely 10 right?

I think one possible way of visualising this problem is to think of it as a
20x20 matrix, with the rows representing the questions and the columns
representing the answers; a cell is marked (with an 'x', say) to show that a
certain question has been assigned to a certain answer. A valid test outcome
has each row and each column containing exactly one 'x'. An 'x' on the leading
diagonal represents a right answer.
Let's generalise the problem to T tests and R right answers, and let's suppose
we don't have to consider the order in which the questions are answered  we are
only interested in the outcome.
The total number of possible test outcomes is thus Nt = T! This is arrived at
by arguing that the 'x' in the first column has a choice of 20 cells, the second
a choice of 19 cells etc.
The number of ways, Nr, of generating exactly R right answers is the product of
the number of ways of scattering R 'x's down the leading diagonal, Nd, and the
number of ways of filling in the remaining columns with 'x's *off* the leading
diagonal, No.
We would have Nd = T!/((TR)! * R!) as this is the number of different ways of
arranging R things in T places, regardlessof order.
Then we have TR columns left, each of which has the cell on the leading
diagonal forbidden to us, as well as the rows already containing 'x's for right
answers. The first column we add an 'x' to would thus have (TR1) valid cells
available. So we would have No = (TR1)! using a similar argument as that for
Nt.
The chance, Pr, of getting *exactly* R right answers in T tests is therefore
Nr/Nt = (Nd * No) / Nt = (T! * (TR1)!) / (T! * (TR)! * R!)
Simplifying the above expression, we get:
Pr = (TR1)! / (R! * (TR)!)
For T = 20, R = 1 I get Pr = 18! / (1! * 19!) = 1/19 = 0.0526
For T = 20, R= 10 I get Pr = 9!/(10! * 10!) = 1/(10 * 10!) = 2.76 x 10^8
I am sorry that my answers differ from the previously quoted ones! It is of
course possible that the above is in error, and maybe[1] one of the real
mathematicians here will correct me in that case. Even if the above is wrong,
the method may be of interest. Or, of course, it may be right!
[1] As this is cam.misc, that is an absolute certainty, whether I am right or
wrong! 

Back to top 


alan truelove science forum beginner
Joined: 09 Jun 2005
Posts: 8

Posted: Fri Jun 10, 2005 4:03 pm Post subject:
Re: Probability question



Piled higher and deeper ...
3 groups of n objects each are presented; select one object from each
group (a 'triad')
Given the first object, the (correct) other two are unique.
Repeat until all triads have been selected.
(Note  this setup is modified in 'Q' and 'R' below for
computational purposes..)
P(n,x) is prob. of getting exactly x correct triads
Q(n,y) is prob. of getting y triads correct, with in each group  n
'good' objects ,plus one 'dummy' object which cannot form part of a
correct triad.
R(n,z) is prob. of getting z triads correct, with in each group  n
'good' objects + TWO dummy objects.
P(n,x)=P(n1,x1)/n^2 + 3(n1)Q(n2,x)/n^2 + (n1)(n2)R(n3,x)/n^2
Q(n,y)=P(n,y)/(n+)^2 + 3nQ(n1,y)/(n+1)^2 + n(n1)R(n2,y)/(n+1)^2
R(n,z)=4 Q(n,z)/(n+2)^2 + (n^2 + 4n)R(n1,z)/(n+2)^2
'       
'match across 3 sets of 20
' alan j truelove 6/10/05
'571 242 0153 'alan_truelove@hotmail.com
Imports System.Math
Public Class Form1
Inherits System.Windows.Forms.Form
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim i, j, iii, jjj, ii, jj As Integer
ReDim P(100, 100)
ReDim Q(100, 100)
ReDim R(100, 100)
'P(n,x)=P(n1,x1)/n^2 + 3(n1)Q(n2,x)/n^2 +
(n1)(n2)R(n3,x)/n^2
'Q(n,y)=P(n,y)/(n+)^2 + 3nQ(n1,y)/(n+1)^2 +
n(n1)R(n2,y)/(n+1)^2
'R(n,z)=4 Q(n,z)/(n+2)^2 + (n^2 + 4n)R(n1,z)/(n+2)^2
P(1, 1) = 1
P(1, 0) = 0
Q(1, 1) = 0.25
Q(1, 0) = 0.75
Q(0, 0) = 1
R(1, 1) = 1 / 3
R(1, 0) = 2 / 3
R(0, 0) = 1
'      
For n = 2 To 20
'  
P(n, n) = 1
For jj = 2 To n
P(n, n) = P(n, n) * jj
Next
P(n, n) = 1 / P(n, n) ^ 2
'  
P(n, n  1) = 0
pstr = n & " p " & P(n, n)
ptot = P(n, n)
For x = n  1 To 0 Step 1
' if we got a hit first
If x < n  1 Then 'not needed for P(n,n1)
P(n, x) = 0
If (x > 0) Then P(n, x) = P(n  1, x  1) / n ^ 2
If n > 1 And x < n  1 Then P(n, x) = P(n, x) + _
3 * (n  1) * Q(n  2, x) / n ^ 2
If n > 2 Then P(n, x) = P(n, x) + _
(n  1) * (n  2) * R(n  3, x) / n ^ 2
End If
' Q(n2,x) is prob  with n2 questions and 1 dummy 
' we match correctly to x out of n1 answers plus one
dummy
' the answer dummy comes because we just used up the
right question for it,
pstr = pstr & " " & Round(P(n, x), 3)
ptot = ptot + P(n, x)
Next
MsgBox(ptot & " P, n " & pstr)
'   
qstr = ""
qtot = 0
For y = n To 0 Step 1
' and the question dummy comes because we have knocked
out the right answer to it
Q(n, y) = P(n, y) / (n + 1) ^ 2
If n > 1 And y < n Then Q(n, y) = Q(n, y) + 3 * n *
Q(n  1, y) / (n + 1) ^ 2
If n > 1 And y < n  1 Then Q(n, y) = Q(n, y) + n * (n
 1) * R(n  2, y) / (n + 1) ^ 2
'if we do match 'on the first dummy question  try,
prob 1/(N+1), then we are left we
' n good questions and n good answers
'n/(n+1) is the prob of not matching dummies
' if we dont match, then we have lost the question
dummy, but another has been created
' it doesnt have a correct answer anywhere
' so we are at n1 questions + 1 dummy
'we have knocked out a good answer (for the new dummy
question) so we have n1 answers
' plus the original dummy
qstr = qstr & " " & Round(Q(n, y), 3)
qtot = qtot + Q(n, y)
Next
MsgBox(qtot & " Q, n " & qstr)
'    
rstr = ""
rtot = 0
For z = n To 0 Step 1
R(n, z) = 4 * Q(n, z) / (n + 2) ^ 2
If z < n Then R(n, z) = R(n, z) + (n ^ 2 + 4 * n) *
R(n  1, z) / (n + 2) ^ 2
rtot = rtot + R(n, z)
rstr = rstr & " " & Round(R(n, z), 3)
Next
MsgBox(rtot & " R, n " & rstr)
Next
End
End Sub
End Class
'    
Module global
Public Q(,), P(,), R(,), ptot, qtot, rtot As Single
Public n, x, y, z As Integer
Public pstr, qstr, rstr As String
End Module 

Back to top 


Scott Hemphill science forum beginner
Joined: 09 Jun 2005
Posts: 21

Posted: Fri Jun 10, 2005 4:21 pm Post subject:
Re: Probability question



Martin Evans <Martin.Evans@arm.com> writes:
Quote:  alan truelove wrote:
From rec.org.mensa
anyone got a slicker solution ??
'            
A student sits a test that has 20 questions; every question has precisely 1
matching answer. There are 20 answers, no duplication. The student answers
every question with a different answer from the 20.
What is the probability, of a student answering randomly, answering
precisely 1 right? precisely 10 right?
I think one possible way of visualising this problem is to think of it as a
20x20 matrix, with the rows representing the questions and the columns
representing the answers; a cell is marked (with an 'x', say) to show that a
certain question has been assigned to a certain answer. A valid test outcome
has each row and each column containing exactly one 'x'. An 'x' on the leading
diagonal represents a right answer.
Let's generalise the problem to T tests and R right answers, and let's suppose
we don't have to consider the order in which the questions are answered  we are
only interested in the outcome.
The total number of possible test outcomes is thus Nt = T! This is arrived at
by arguing that the 'x' in the first column has a choice of 20 cells, the second
a choice of 19 cells etc.
The number of ways, Nr, of generating exactly R right answers is the product of
the number of ways of scattering R 'x's down the leading diagonal, Nd, and the
number of ways of filling in the remaining columns with 'x's *off* the leading
diagonal, No.
We would have Nd = T!/((TR)! * R!) as this is the number of different ways of
arranging R things in T places, regardlessof order.
Then we have TR columns left, each of which has the cell on the leading
diagonal forbidden to us, as well as the rows already containing 'x's for right
answers. The first column we add an 'x' to would thus have (TR1) valid cells
available. So we would have No = (TR1)! using a similar argument as that for
Nt.
The chance, Pr, of getting *exactly* R right answers in T tests is therefore
Nr/Nt = (Nd * No) / Nt = (T! * (TR1)!) / (T! * (TR)! * R!)
Simplifying the above expression, we get:
Pr = (TR1)! / (R! * (TR)!)
For T = 20, R = 1 I get Pr = 18! / (1! * 19!) = 1/19 = 0.0526
For T = 20, R= 10 I get Pr = 9!/(10! * 10!) = 1/(10 * 10!) = 2.76 x 10^8
I am sorry that my answers differ from the previously quoted ones! It is of
course possible that the above is in error, and maybe[1] one of the real
mathematicians here will correct me in that case. Even if the above is wrong,
the method may be of interest. Or, of course, it may be right!

And what is the probability for 19 right answers out of 20? Hint: where
does the 20th answer go?
Quote:  [1] As this is cam.misc, that is an absolute certainty, whether I am right or
wrong!

There are a few more newsgroups than just cam.misc.
Scott

Scott Hemphill hemphill@alumni.caltech.edu
"This isn't flying. This is falling, with style."  Buzz Lightyear 

Back to top 


alan truelove science forum beginner
Joined: 09 Jun 2005
Posts: 8

Posted: Fri Jun 10, 2005 4:29 pm Post subject:
Re: Probability question



Quote:  we get:
Pr = (TR1)! / (R! * (TR)!)
For T = 20, R = 1 I get Pr = 18! / (1! * 19!) = 1/19 = 0.0526
For T = 20, R= 10 I get Pr = 9!/(10! * 10!) = 1/(10 * 10!) = 2.76 x 10^8
I am sorry that my answers differ from the previously quoted ones! It is of
course possible that the above is in error, and maybe[1] one of the real
mathematicians here will correct me in that case. Even if the above is wrong,
the method may be of interest. Or, of course, it may be right!
   
I applaud your efforts  but I took T=4, and got a total for all
probs R=0,1,2,3,4 of 6.25
Shomething wrong shurely!
(I may well have made a dumb mistake ..)
with best wishes
'   
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim i, j, iii, jjj, ii, jj As Integer
ReDim P(100, 100)
ReDim Q(100, 100)
Dim T, R, Rfact, TRfact, TR1fact As Integer
Dim tot, hold As Single
T = 4
TRfact = fact.fact(T  R)
TR1fact = fact.fact(T  R  1)
tot = 0
For R = 0 To T
Rfact = fact.fact(R)
TRfact = fact.fact(T  R  1)
'(TR1)! / (R! * (TR)!)
hold = Rfact * TRfact
If hold > 0 Then tot = tot + TR1fact / hold
Next
MsgBox(tot)
end sub
'   
Module fact
Function fact(ByVal j As Integer) As Integer
Dim i As Integer
fact = 1
If j = 0 Then
fact = 0
Exit Function
End If
For i = 2 To j
fact = fact * i
Next
End Function
End Module 

Back to top 


alan truelove science forum beginner
Joined: 09 Jun 2005
Posts: 8

Posted: Fri Jun 10, 2005 5:56 pm Post subject:
Re: Probability question



(Correctedt code!)
 but I took T=4, and got a total for all
Quote:  probs R=0,1,2,3,4 of 0.5833
Shomething wrong shurely!
(I may well have made a dumb mistake ..)
with best wishes
'   
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles Button1.Click
Dim i, j, iii, jjj, ii, jj As Integer
ReDim P(100, 100)
ReDim Q(100, 100)
Dim T, R, Rfact, TRfact, TR1fact As Integer
Dim tot, hold As Single
T = 4
tot = 0
For R = 0 To T
TRfact = fact.fact(T  R)
TR1fact = fact.fact(T  R  1)
Rfact = fact.fact(R)
'(TR1)! / (R! * (TR)!)
hold = Rfact * TRfact
If hold > 0 Then tot = tot + TR1fact / hold
Next
MsgBox(tot)
Quote:  '   
Module fact
Function fact(ByVal j As Integer) As Integer
Dim i As Integer
fact = 1
If j = 0 Then
fact = 0
Exit Function
End If
For i = 2 To j
fact = fact * i
Next
End Function
End Module 


Back to top 


Scott Hemphill science forum beginner
Joined: 09 Jun 2005
Posts: 21

Posted: Fri Jun 10, 2005 7:31 pm Post subject:
Re: Probability question



Martin Evans <Martin.Evans@arm.com> writes:
Quote:  Then we have TR columns left, each of which has the cell on the leading
diagonal forbidden to us, as well as the rows already containing 'x's for right
answers. The first column we add an 'x' to would thus have (TR1) valid cells
available. So we would have No = (TR1)! using a similar argument as that for
Nt.

This is where the error is. The first column will indeed have (TR1) valid
cells. However the second column and each additional column will will either
have (TR2) valid cells or (TR1) valid cells depending on whether the
corresponding row has already been picked.
For example, consider the case where TR = 3, and just look at the 3x3 matrix
of containing the remaining rows and columns.
X . .
X . O = chosen, X = unavailable
O . X
Working column by column, if we pick the third row for the first column,
then there is only one choice for the second column.
X . .
O X .
. . X
If we instead pick the second row for the first column, then there are
two choices for the second column.
Quote:  The chance, Pr, of getting *exactly* R right answers in T tests is therefore
Nr/Nt = (Nd * No) / Nt = (T! * (TR1)!) / (T! * (TR)! * R!)
Simplifying the above expression, we get:
Pr = (TR1)! / (R! * (TR)!)

This formula can't be right. What if T=R? You get a (1)! term (which is
infinite).
If you have a correct formula, you should expect it to get the correct
results for easily verifiable simple cases:
T = 0
R = 0, Pr = 1
T = 1
R = 0, Pr = 0
R = 1, Pr = 1
T = 2
R = 0, Pr = 1/2
R = 1, Pr = 0
R = 2, Pr = 1/2
T = 3
R = 0, Pr = 1/3
R = 1, Pr = 1/2
R = 2, Pr = 0
R = 3, Pr = 1/6
T = nonnegative integer
R = T1, Pr = 0
R = T, Pr = 1/T!
You should also expect that the sum of the probabilities for a given T
will be one!
Scott

Scott Hemphill hemphill@alumni.caltech.edu
"This isn't flying. This is falling, with style."  Buzz Lightyear 

Back to top 


Alex Selby science forum beginner
Joined: 30 May 2005
Posts: 10

Posted: Fri Jun 10, 2005 9:53 pm Post subject:
Re: Probability question



alan truelove wrote:
Quote:  From rec.org.mensa
anyone got a slicker solution ??
'            
On Thu, 9 Jun 2005 13:56:11 +0200, "Mark"
Markiehatesspam@notelespam2.fr> wrote:
"BruceS" <bruces42@hotmail.com> wrote in message
news:1118264621.238754.254340@f14g2000cwb.googlegroups.com...
I wouldn't be at all offended if you reposted there and returned here
with any answers. I try to avoid crossposting, especially to groups I
don't follow.
Here then is the question as I remember it:
on consideration this may not be precisely on topic for sci.stat.math
although I suppose that in general people who are up on stats are up on
probability too.
A student sits a test that has 20 questions; every question has precisely 1
matching answer. There are 20 answers, no duplication. The student answers
every question with a different answer from the 20.
What is the probability, of a student answering randomly, answering
precisely 1 right? precisely 10 right?
Mark
'   
Getting 1 right: 0.3679
Getting 10 right: 0.01378 * 10^(7)
'   

The probability of getting r right out of n is D(nr)/(r!(nr)!)
where D(k) = / 1 if k=0
\ the nearest integer to k!/e if k>0
This is well approximated by 1/(r!e) if r isn't too close to n.
(Reference: Google for "hats","derangements","Poisson","inclusion")

Alex 

Back to top 


alan truelove science forum beginner
Joined: 09 Jun 2005
Posts: 8

Posted: Sat Jun 11, 2005 5:23 am Post subject:
Re: Probability question



Piled higher and even more deeper ..
Develop iterative method for the following
and then show a VB.Net code to implement it ..
(I have a nice solution which goes on from my previous solutions, and
uses a neat combinatorial method, but this space is too small to
contain it)
OK, it's June 11th, 2005, let's just see...
..            
k groups of n objects each are presented; select one object from each
group (a 'tuple')
Given the first object, the (correct) other k1 are unique.
Repeat until all tuples have been selected.
P(k,n,x) is prob(get x correct tuples) 

Back to top 


Martin Evans science forum beginner
Joined: 10 Jun 2005
Posts: 3

Posted: Mon Jun 13, 2005 11:09 am Post subject:
Re: Probability question



Scott Hemphill wrote:
Quote:  Pr = (TR1)! / (R! * (TR)!)
And what is the probability for 19 right answers out of 20? Hint: where
does the 20th answer go?

For T = 20 and R = 19 we get Pr = (20  19  1)!/(19! * (20  1)!) = 0!/19! = 0
I think this is what we would expect  the probablity of getting exactly 19 questions
right would be zero, wouldn't it? PS  I don't need the hint, thanks! :P
Quote: 
[1] As this is cam.misc, that is an absolute certainty, whether I am right or
wrong! :)
There are a few more newsgroups than just cam.misc.

Yes, of course there are. 

Back to top 


Scott Hemphill science forum beginner
Joined: 09 Jun 2005
Posts: 21

Posted: Mon Jun 13, 2005 12:39 pm Post subject:
Re: Probability question



Martin Evans <Martin.Evans@arm.com> writes:
Quote:  Scott Hemphill wrote:
Pr = (TR1)! / (R! * (TR)!)
And what is the probability for 19 right answers out of 20? Hint: where
does the 20th answer go?
For T = 20 and R = 19 we get Pr = (20  19  1)!/(19! * (20  1)!) = 0!/19! = 0
I think this is what we would expect  the probablity of getting exactly 19 questions
right would be zero, wouldn't it? PS  I don't need the hint, thanks!

No. 0! is not zero. It is one.
Scott

Scott Hemphill hemphill@alumni.caltech.edu
"This isn't flying. This is falling, with style."  Buzz Lightyear 

Back to top 


Scott Hemphill science forum beginner
Joined: 09 Jun 2005
Posts: 21

Posted: Mon Jun 13, 2005 12:45 pm Post subject:
Re: Probability question



Scott Hemphill <hemphill@hemphills.net> writes:
Quote:  Martin Evans <Martin.Evans@arm.com> writes:
Scott Hemphill wrote:
Pr = (TR1)! / (R! * (TR)!)
And what is the probability for 19 right answers out of 20? Hint: where
does the 20th answer go?
For T = 20 and R = 19 we get Pr = (20  19  1)!/(19! * (20  1)!) = 0!/19! = 0
I think this is what we would expect  the probablity of getting exactly 19 questions
right would be zero, wouldn't it? PS  I don't need the hint, thanks! :P
No. 0! is not zero. It is one.

I mean, yes the probability is zero. But, no your formula doesn't produce
that result.
Scott

Scott Hemphill hemphill@alumni.caltech.edu
"This isn't flying. This is falling, with style."  Buzz Lightyear 

Back to top 


Google


Back to top 



The time now is Sat Oct 20, 2018 6:53 pm  All times are GMT

