1

Let s say we have an algorithm that takes as input 3 matrix A,B and C

$$ \text{Input} :A,B,C \in Mat(n\times n)$$ $$\text{Question} :\text{is } A\cdot B=C$$

the algorith works as follow ;

$$ \text{if }(A\cdot B)_{ij}=C_{ij} \Rightarrow A\cdot B=C $$ $$ \text{if }(A\cdot B)_{ij} \neq C_{ij} \Rightarrow A\cdot B \neq C $$

with random chosen $i$ and $j$ .

I have to find in this case the error probrabilty. Can someone please give me some hints.

This problem looks a bit like the freivalds algorithm, somehow i think i have to drive a trick with it so solve mine but i am not sure .

Narek Bojikian
  • 4,784
  • 1
  • 13
  • 36
Mohbenay
  • 319
  • 2
  • 10

2 Answers2

1

If that's the whole algorithm, only one iteration, then the only bound on the probability of error you can get is that it is smaller than $1-1/n^2$.

Hint 1) Notice that the algorithm only can fail when it enters in the first case you describe, why?

Hint 2) What is the worst possible case for A, B and C so you get the worse probability of error?

0

If I create the matrix C by calculating AB, then change a single entry in C, then you need to calculate x% of all entries to have an x% chance to find the incorrect entry.

If I change an entry in A or B, then you just need to calculate 2n entries ( but the right ones) to find AB != C.

So really your question is unanswerable until you get more information about A, B and C.

gnasher729
  • 32,238
  • 36
  • 56