1-sparse recovery algorithm In the reference below, a 1-sparse recovery algorithm over a vector $a \in R^n$ is defined as follows. My question is why do we need the modulus (i.e. $x \mod p$)?
Algorithm:

Keep track of
$$
   \begin{split}
   w_1 &amp;= \sum a_i \\
   w_2 &amp;= \sum i a_i \\
   w_3 &amp;= \sum a_i z^i \mod p
   \end{split}
   $$
Test if
$$
   \begin{split}
   w_3 \equiv w_1 \cdot z^{w_2 / w_1} \mod p
   \end{split}
   $$
For some large prime $p$.

Reference: Section 3.2, &quot;1-sparse recovery: second attempt&quot;, https://web.stanford.edu/class/cs369g/files/lectures/lec11.pdf
Without the mod p, the running time to check the condition would be exponential, which is unacceptable.  Also, it would require exponential space to store $w_3$ and to check the condition.
Also, the procedure involves choosing an integer $z$ uniformly at random from $\&gt;0,\dots,p-1\}$.  You can choose an integer uniformly at random from $\{0,\dots,p-1\}$, but you can't choose it uniformly at random from the set of all integers.  So, you'd have to think about exactly what alternative approach you had in mind if you wanted to omit the mod p.