Here's a direct, manual way to do it. Trying to create a series WITHOUT repetition from a repeating series is a torment. Don't try it, unless you have time: R is made for this.
What you need to use my code:
What you need to create other samples:
- install R on your system, unless you have
- run e.g. R as commandline/terminal (Rterm)
n<-sample(1:52,52,replace=F); paste(n,collapse=",")
- copy from there:
[1] "48,20,50,26,1,6,30,17,22, ..."
Decoded:
n<-sample(1:52,52,replace=F)
creates 52 samples from range 1:52 WITHOUT repetition, storing it in n
(as list)
paste(n,collapse=",")
inserts ,
inbetween, as that's what tikz likes (1,2,3
instead of 1 2 3
)
To run within your Latex environment ...
You'll need packages iexec
and shellesc
. See their documentation.
See also tag r on this site.

What the code does:
- regular
\foreach
command, augmented by a counting variable [count=\i]
(index within the list)
- drawing some horizontal strokes
\draw (\i,\r) -- +(2,0);
- kindly recognize the uniform distribution of the sampled numbers
\documentclass[10pt,border=1cm,tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \r [count=\i] in { 48,20,50,26,1,6,30,17,22,8,42,35,45,21,39,44,49,7,31,40,19,47,3,18,5,12,52,38,13,41,15,9,16,29,27,43,37,23,4,51,32,36,25,28,34,10,24,14,46,33,11,2}
\draw (\i,\r) -- +(2,0);
\end{tikzpicture}
\end{document}
From Rterm:
> n<-sample(1:52,52,replace=F); paste(n,collapse=",")
[1] "48,20,50,26,1,6,30,17,22,8,42,35,45,21,39,44,49,7,31,40,19,47,3,18,5,12,52,38,13,41,15,9,16,29,27,43,37,23,4,51,32,36,25,28,34,10,24,14,46,33,11,2"
\documentclass[a4paper]{article} \usepackage{tikz} \begin{document} \foreach \No in {1,...,11}{\noindent No\No: \pgfmathparse{rnd}\pgfmathresult\\}} \end{document}
.\pgfmathdeclarerandomlist{mynum}{{1}{2}{3}{4} ....... {52}
}