While I'm sure there's a direct method to generate integers from 1 to 4 so that they have probabilities 0.1, 0.2, 0.3, and 0.4, an indirect or two-step method is more straightforward to set up. First, generate an integer between 1 and 10 randomly. (I.e., each integer has P=0.1
.) Second, check if the integer is less than 2, 4, and 7, respectively, and assign the numbers "1", "2", "3" accordingly -- and associate the number "4" with the "none of the above" category, i.e. if the integer is between 7 and 10.
Here's a LuaLaTeX-based implementation of this idea.

\documentclass{article}
\newcommand\x{%
\directlua{x=math.random(10) % draw an integer between 1 and 10
if x<2 then tex.sprint(1) % true if x==1
elseif x<4 then tex.sprint(2) % true if x==2 or 3
elseif x<7 then tex.sprint(3) % true if x==4, 5, or 6
else tex.sprint(4) % true if x==7, 8, 9, or 10
end}}
\begin{document}
\obeylines % just for this example
\x, \x, \x, \x, \x; \x, \x, \x, \x, \x; \x, \x, \x, \x, \x; \x, \x, \x, \x, \x
\x, \x, \x, \x, \x; \x, \x, \x, \x, \x; \x, \x, \x, \x, \x; \x, \x, \x, \x, \x
\x, \x, \x, \x, \x; \x, \x, \x, \x, \x; \x, \x, \x, \x, \x; \x, \x, \x, \x, \x
\x, \x, \x, \x, \x; \x, \x, \x, \x, \x; \x, \x, \x, \x, \x; \x, \x, \x, \x, \x
\end{document}
{{1}{2}{2}{3}{3}{3}{4}{4}{4}{4}}
as your random list should be enough.