  We present a unified framework to study threshold functions for the existence
of solutions to linear systems of equations in random sets which includes
arithmetic progressions, sum-free sets, $B_{h}[g]$-sets and Hilbert cubes. In
particular, we show that there exists a threshold function for the property
"$\mathcal{A}$ contains a non-trivial solution of
$M\cdot\textbf{x}=\textbf{0}$", where $\mathcal{A}$ is a random set and each of
its elements is chosen independently with the same probability from the
interval of integers $\{1,\dots,n\}$. Our study contains a formal definition of
trivial solutions for any combinatorial structure, extending a previous
definition by Ruzsa when dealing with a single equation.
  Furthermore, we study the behaviour of the distribution of the number of
non-trivial solutions at the threshold scale. We show that it converges to a
Poisson distribution whose parameter depends on the volumes of certain convex
polytopes arising from the linear system under study as well as the symmetry
inherent in the structures, which we formally define and characterize.
