@JouleV And if you do not want to use lualatex:
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[clip] (0,0) rectangle (8,4);
\foreach \X in {1,...,1000}
{\pgfmathsetmacro{\myx}{rnd*8}
\pgfmathtruncatemacro{\itest}{ifthenelse(2*rnd<1+sin(\myx*300/pi),1,0)}
\ifnum\itest=1
\fill(\myx,4*rnd) circle[radius=1pt];
\fi
}
\end{tikzpicture}
\end{document}