wu :: forums
« wu :: forums - No of Independent Event.. »

Welcome, Guest. Please Login or Register.
Apr 26th, 2024, 2:33pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: william wu, Eigenray, Icarus, Grimbal, towr, ThudnBlunder, SMQ)
   No of Independent Event..
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: No of Independent Event..  (Read 856 times)
k3rn3l
Newbie
*





   


Posts: 6
No of Independent Event..  
« on: Feb 14th, 2009, 10:21am »
Quote Quote Modify Modify

Given n ( Sample Space = S)  and two events  A (subset of S ) and B ( subset of S)..How many possible combo of A  & B will be independent event..??
 
n can be considered to be a dice with n faces wth equal probability of each face..
 
Like for example n = 3;  
Total number of independent event is 13
 
Here it is :  
Code:
(1,2,3)     ( 1 )
(1,2,3)     ( 2 )
(1,2,3)     ( 3 )
(1,2,3)     ( 1,2 )
(1,2,3)     ( 1,3 )
(1,2,3)     ( 2,3 )
 
total = 6;
 
Reversing the set : again 6 so total = 12;
and one combo is (1,2,3) and (1,2,3)
therefore total = 13;
 

 
Quote:
independent event  A and B if:
 
P ( A intersection B) = P(A) * P(B);

I know the value will increase rapidly with n ...so output will be d value  after taking mod of 100000000.
 
Thnks in advance...i tried it solving for 2 hrs but i m not able..!!
 
Some ans i may give...for ur checking:
n = 6 ---->  845
      7 ---->  253
      8 ----> 7509
      9 ---->16141
 
Code:

and i have another question T(n) = 1/sqrt(n)..
what will be T(n)..??
« Last Edit: Feb 14th, 2009, 12:09pm by k3rn3l » IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: No of Independent Event..  
« Reply #1 on: Feb 14th, 2009, 1:26pm »
Quote Quote Modify Modify

Here's a bit of javascript that solves the first problem in O(n3)-ish time.
There's definite room for improvement, though (e.g. you can solve for c) . But I don't plan on working on this any more tonight.
Code:
<script>
 
function fac(n)
{
  if (n < 2) return 1;
  return n * fac(n-1);
}
 
for(s=1; s < 10; s++)
{
  t=0;
  for(a=0; a <=s; a++)
    for(b=0; b <=s; b++)
      for(c=1;  a+b+c <= s ; c++)
        if (c*s == (a+c)*(b+c))
        {
          t += fac(s)/fac(a)/fac(b)/fac(c)/fac(s-a-b-c)
        }
 
  document.write("s: " + s + "  " + t + "<br>");
 
}
document.close();
 
</script>

 
It's interesting how the results of prime numbers jump out. (Although not surprising, once you understand how this algorithm works)
« Last Edit: Feb 14th, 2009, 1:32pm by towr » IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Eigenray
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 1948
Re: No of Independent Event..  
« Reply #2 on: Feb 14th, 2009, 6:54pm »
Quote Quote Modify Modify

Using the same formula, a Mathematica one-liner:
Code:
Sum[Total[s!/(c!(#-c)!(s c/#-c)!(s - # - s c/# + c)!) &/@Select[Divisors[s c], c <= # <= s &]], {c,1,s}]
« Last Edit: Feb 14th, 2009, 6:55pm by Eigenray » IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board