[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

1290.0. " Probability Problem- Matrix of 0's and 1's." by HPSRAD::ABIDI (It's a wild world) Fri Aug 24 1990 14:18

    
    Consider an MxN matrix of 1's and 0's.
    An "error_condition" is said to exist iff
        (1) There is at least one 1 in the matrix
    AND (2) All rows and All columns of the matrix have an even sum. 
    
    For example,
                  0100010
                  0000000
                  0001010
                  0101000
      has an "error_condition"
    
     but
             0100010
             0000000
             0100001
       does not.
    
     Given: the probability of an element being 1 is p (so the prob of 
     it being 0 is 1-p), what is the probability of an "error-condition" ?
T.RTitleUserPersonal
Name
DateLines
1290.1A small step toward solving the problemTRACE::GILBERTOwnership ObligatesFri Aug 24 1990 17:3515
Given that p is the probability of an element being a 1 (otherwise it is a 0), then
the probability that the sum of m elements is even is given by

	[m/2]
        ====
	\     ( m )        m-2*i  2*i
	 >    (   ) (1 - p)      p
	/     (2*i)
	====
	 i=0

which is simply

	       m
	(1-2*p)
1290.2Doesn't that assume independent events?VMSDEV::HALLYBThe Smart Money was on GoliathFri Aug 24 1990 21:001
    
1290.3re .2 -- of courseTRACE::GILBERTOwnership ObligatesFri Aug 24 1990 23:540
1290.4some more stepsHERON::BUCHANANcombinatorial bomb squadSat Aug 25 1990 16:22113
(1) Minor suggestion

>TRACE::GILBERT
>Given that p is the probability of an element being a 1 (otherwise it is a 0), 
>then the probability that the sum of m elements is even is given by
>
>	[m/2]
>        ====
>	 \     ( m )        m-2*i  2*i
>	  >    (   ) (1 - p)      p
>	 /     (2*i)
> 	 ====
>	 i=0

	Yup.

>which is simply
>
>	       m
>	(1-2*p)

	Nearly.   I make it:
		    m
	�(1 + (1-2p) )

	To believe this, firstly look at the examples p = 0,� & 1, and n = 0 &
% (infinity).   Next see that if x & y are any variables, then:
		m       m
	�( (x+y) + (x-y) )

will contain exactly the terms of even order in y.   All we have here is the
special case y = p, x = 1-p.   Denote 1-p by q.


(2) Some particular values of p.

p = 0:	all row and column sums are always even.
p = �:	the probability that all row and column sums are even is �^(m+n-1).
p = 1:	need m & n both even, then evenness of sums is guaranteed.


(3) Simple cases: n = 1,2,3.

	Now to return to our original problem, let P(m,n) [m,n>0] denote the 
probability that all row-sums and all column-sums in an m by n array are
even.   We ignore the distracting condition that at least one 1 must be 
present, since that is a trivial tack-on at the end.

	While pursuing trivia, we might as well say:
		P(m,n) = P(n,m)
		P(m,1) = q^m

	Now P(m,2) we can get from the formula above, setting y = p�, and
x = q�, P(m,2) =
		  m	    m
	�( (q�+p�) + (q�-p�) )

Note that this happens because each column must contain two elements the same,
for the column sum to be even.   P(m,3) is not that easy.   However, it is
"obvious" :-) that:

	P(m+1,3) = q�*P(m,3) + p�q*[ (q�+3p�q)^m - P(m,3) ]

		 = (q�-p�q)*P(m,3) + p�q*(q�+3p�q)^m
	
	P(m,3)	 = sum(j=0,...m-1) (q�-p�q)^j * (q�+3p�q)^(m-j) * p�q
				 + (q�-p�q)^m

		 = [ (q�+3p�q)^m + 3(q�-p�q)^m ] / 4

	This works for p = 0,�,1.


(4) n >= 4

	Let P(m,4) be as before.   Let Q(m,4) be the probability that all
column sums are even, and all row sums are odd.   Then, using the same trick
as before:

	P(m+1,4) = q^4*P(m,4) + p^4*Q(m,4)
		 + p�q�*[ (p^4 + 6p�q� + q^4)^m - P(m,4) - Q(m,4)]
	Q(m+1,4) = p^4*P(m,4) + q^4*Q(m,4)
		 + p�q�*[ (p^4 + 6p�q� + q^4)^m - P(m,4) - Q(m,4)]

	The only real difference between P & Q is in the transient:
P(0,4) = 1, Q(0,4) = 0.

	Letting S = P+Q, R = P-Q

	S	 = (p^4+q^4)*S + 2*p�q�*[(p^4 - 6p�q� + q^4) - S]
		 = (p^4 -2p�q� +q^4)*S + 2*p�q�*(p^4 - 6p�q� + q^4)
	R	 = (q^4-p^4)*R

is clearly going to give us the answer for P(m,4).   The question is, what is
the function as n becomes still bigger?

	We say that K(m,n,x) is the probability that an array of m columns and
n rows has the properties:
	(1) each column sum is odd
	(2) exactly x of the row sums are odd.

	Note:	(i) K(m,n,0) = P(m,n)
		(ii) K(m,n,x) = 0 if x is odd

	Then we can build a recursion in m.   We can see that this will
give us the vector K(m+1,n,.) as a linear function of K(m,n,.).   Thus 
K(m,n,.) is expressible as a sum of mth powers of various functions of p&q
(n being held constant all the while).

	I haven't time to take this further.

Regards,
Andrew.