A Simplified Proof For The Application Of Freivalds Technique to Verify Matrix Multiplication
Fingerprinting is a well known technique, which is often used in designing Monte Carlo algorithms for verifying identities involving ma- trices, integers and polynomials. The book by Motwani and Raghavan [1] shows how this technique can be applied to…
Authors: Vamsi K. Kundeti
A Simplified Pro of F or The Application Of F reiv alds’ T ec hnique to V erify Matrix Multiplication V amsi Kundeti Department of Computer Science and Engineering Universit y of Connecticut Storrs, CT 06269, U SA {vamsik}@e ngr.uconn. edu Abstract. Finge rprinting is a well know n technique, whic h is often used in designing Mon te Carlo algorithms for verifying identities in volving ma- trices, integers and polynomials. The b o ok by Motw ani and Raghav an [1] sho ws how this tec hniqu e can b e applied to chec k the correctness o f ma- trix multiplica tion – chec k i f A B = C where A, B and C are three n × n matrices. The result is a Monte C arlo algorithm running in t ime Θ ( n 2 ) with an exponentially decreasing erro r probabilit y af ter eac h i ndep en- dent iteration. In this pap er w e give a simple alternate pro of addressi ng the same problem. W e also giv e further generalizations and relax v arious assumptions made in t he pro of. 1 In tr o duction Fingerprinting or F r eivalds’ te chnique is a standar d metho d which is often em- ploy ed in desig ning Mon te Carlo algo rithms. Let U be a large univ erse/se t of elements, given a n y x, y ∈ U our g oal is to chec k if x and y are the s a me. Since we need Θ (log ( U )) bits to re pr esent an y x, y ∈ U , this means chec king if x = y deter ministically would need Ω (lo g( U )) time. The ba sic idea behind finger prin ting is create a random m apping r : U → V such that | V | ≪ | U | , and verify if V ( x ) = V ( y ). How ever it should be clear tha t V ( x ) = V ( y ) do es not necessarily mean x = y – in fact the go a l is to fin d a V suc h the err or pr ob ability P [ V ( x ) = V ( y ) | x = y ] is very sma ll. Once w e prov e that our err or pr ob ability is b o unded by some co nstant, a Mo nt e Carlo algor ithm is clearly immediate. Motw ani and Raghav an [1] applied this technique to chec k the co rrectness o f matrix multiplication, w e sta te the as follows. Giv en thre e n × n matrices A, B and C check if AB = C . Clearly a simple deterministic a lgorithm takes Θ ( n 3 ) time. Firstly In this paper we give a simple alternate pro o f fo r the Theorem-7 . 2 presented in [1], secondly we relax v arious co ns traints and give a muc h general pro of. 2 V amsi Kundeti 2 Our P ro ofs W e first give a simple and alternative pro of for Theor e m-7 . 2 in [1]. La ter in Theorem 2 w e show that the assumption on the u niformness is not necessary . Theorem 1. L et A , B and C b e thr e e n × n matric es such that AB 6 = C . L et r ∈ { 0 , 1 } n is a r andom ve ctor fr om a uniform distribution. Th en P [ AB r = C r | AB 6 = C ] ≤ 1 / 2 Pr o of. Let X b e a n × n matrix a nd x 1 , x 2 . . . x n be the column vectors of X . Then X r = P n i =1 r i x 1 . This mea ns that multiplying a vector with a matrix is linear c o mbin ation of the columns, the co efficient r i is the i th comp onent of r . Since r is a b o olea n a nd r i acts as an indicator v aria ble on the selection of column x i . So if r is chosen from a u niform distribution P [ r i = 0 ] = P [ r i = 1 ] = 1 / 2. Now let D = AB a nd d 1 , d 2 . . . d n be the column vectors o f D , similarly let c 1 , c 2 . . . c n be the column vectors o f C . Let Y = { d j | d j 6 = c j , cle arly | Y | ≥ 1 since C 6 = D . Then P [ AB r = C r | AB 6 = C ] = Π d i / ∈ Y P [ r i ] = (1 / 2 ) n −| Y | ≤ 1 / 2 since 1 ≤ | Y | ≤ n − 1. In tuitively this mea ns we s elect our ra ndom vector r such that r i = 0 for all d i ∈ Y , such a sele ction w ill alw ays ensure AB r = C r even though AB 6 = C . Theorem 2. L et A , B and C b e thr e e n × n matric es. L et r ′ = [ r 1 , r 2 . . . r n ] any ve ctor with e ach c omp onent r i is a i.i.d r andom variable r i ∼ f ( r ) . Then P [ AB r = C r | AB 6 = C ] ≤ f ( r ) . Wh er e f ( r ) is an arbitr ary pr ob ability de n- sity/distribution fu nction. Pr o of. Contin uing with the pro of of Theo rem- 1 , P [ AB r = C r | AB 6 = C ] = Π d i / ∈ Y P [ r = r i ] ≤ f ( r ). Corollary 1. The r e always exists an Θ ( n 2 ) time Monte Carlo algorithm with exp onential ly de cr e asing err or pr ob ability, for t he pr oblem to che ck if AB = C . 3 Conclusions W e give a simple and a lternate pro of for the pro of g iven by Motw ani [1], to verify if AB = C using a Mo nte Ca rlo algor ithm. W e a lso r elax uniformness assumption made by the pro o f. References 1. Motw ani, R., Raghav an, P .: Randomized A lgorithms. Cam bridge (1995)
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment