I am new to LaTex, and I don't know how to code something like this, can someone help me out? Thank you so much!

I am new to LaTeX, and I don't know how to type a thing like this, can you help me out? Thank you so much.

2 Answers 2


Something to start with:



        \draw [] (8.5,0) arc (-80:80:0.2cm and 0.5cm);
        \draw [rotate=180] (-0.5,-1) arc (-80:80:0.2cm and 0.5cm);

        \foreach \x in {1,2.5,4,5.5}{
        \draw (\x,0) rectangle (\x+1,1);
        \node at (\x+1.25,0) {,};
        \draw (\x+1.5,0) rectangle (\x+2.5,1);
        \foreach \x \y \z in {1/1/3,2.5/2.5/6,4/4/5,5.5/5.5/4}{
        \node [inner sep=0] (A) at (\x+0.5,0) {};
        \node [inner sep=0] (B) at (\x+0.5,-\y*0.2) {}; 
        \draw [->] (B) edge (A) node[below] {\tiny $\z$ choices};

enter image description here


With a TikZ matrix:


\usetikzlibrary{matrix, positioning}

\matrix[matrix of nodes, 
    nodes in empty cells,
    inner sep=0pt,
    nodes={draw, very thick, minimum size = 16pt},
    column sep=6pt,
    left delimiter={(},
    right delimiter={)}]
\foreach \ind in {1,...,4}
    \node[font=\bfseries] at ([xshift=2pt]mymatr-1-\ind.south east) {,};
\foreach \ind \descr in {1/3,2/6,3/5,4/4}{
        \node[below=\ind*12pt of mymatr-1-\ind] (u\ind) {\descr\ chioces};
        \draw[-Stealth] (u\ind) -- (mymatr-1-\ind);

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.