Question 1:
Given two integer matrices $A$ and $B$, and let $C$ be $AB$.
$C$ can be very big in pratice, so what is the fastest way to compute the statistical data of $C$?
For example,
$$A=\begin{pmatrix}1&2\\3&4\end{pmatrix}$$ $$B=\begin{pmatrix}0&0\\0&1\end{pmatrix}$$
The statistical data of $C$ are:
Value | Appearing times in $C$ |
---|---|
0 | 2 |
2 | 1 |
4 | 1 |
Question 2:
Given a single value $v$, what is the fastest way to know its appearing times in $C$? Computing the product and counting the number is the only way or not?