Working on my answer to  I've found that the distribution of a number of consecutive \bullet (or \cdot) is different if the number is even or odd. Space between two last elements in an even list is shorter. Why? How could it be corrected?  \documentclass{article} \usepackage{pgffor}   \newcommand{\mydots}[1]{$\foreach\i in {1,...,#1}{\bullet}$}  \begin{document} \foreach\i in {1,...,15} {\noindent\mydots{\i}\\} \end{document}
117481
The spacing between the 3rd and 4th stars is non-existent. Anyone know what's up?    \documentclass[11pt]{article}  \usepackage{amsmath}  \begin{document}  \begin{gather*} \star\star\star\star \\ \star\star\star\,\star \\ \star\star\star\star\star \end{gather*}  \end{document}
58023
I am trying to find the total number of signals that can be created from $3$ pink, $3$ white and $2$ black flags when arranged in a straight line. But, only $5$ flags are allowed in a signal.  I know how to find permutations in this situation when all are taken at a time i.e. a signal has $8$ flags, which would be $\frac{8!}{3! \cdot 3! \cdot 2!}$, but cannot see how to start solving a scenario where all are not taken at the same time.  Formula when all are taken at a time with some like objects  $$\frac{n!}{a! \cdot b! \cdot c! \cdot d!...}$$  Question  Is there a modified formula that will give permutations of $n$ objects taken $r$ at a time when some of these objects are alike and $r &lt; n$?
43627
Let $x = x(1), \dots , x(n)$ be a bit string containing exactly $m$ occurrences of 1. Consider the following operation on $x$: we choose a random pair of indices $(i,j),$ and we swap $x(i)$ and $x(j)$ so that $x'(i) = x(j),$ $x'(j) = x(i),$ while $x'(k) = x(k)$ if $k \neq i$ and $k \neq j.$ (If $i = j,$ therefore, then we change nothing.) Let $X_1 = x,$ and let $X_2, \dots, X_N$ be obtained by such a sequence of operations (always swapping a new random pair) that so $X_{r+1} = X_r$. The number of 1s remains $m$ in each iteration. Show for each $i$, we have $P(X_N (i) = 1) \rightarrow \frac{m}{n}$ as $N \rightarrow \infty$.   What's confusing me is that it seems as though the probability on any iteration of $X_j$ that $X_j(i) = 1$ is always $\frac{m}{n}$, which would make the problem trivial.
82385
How come that in the code below, \foreach is unable to give me round numbers?  \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots}  \usetikzlibrary{positioning, calc}  \begin{document}     \begin{tikzpicture} \foreach\x in {0.1,0.2,...,0.9}\node at (0,{-2*\x}){\tiny\x};     \end{tikzpicture} \end{document}
10113
The answer is, according to the book: $(m-1)!\cdot \binom{m+r-1}{r}$ I get why this is true. You arrange $m$ people in their seats in $(m-1)!$ ways and then you put $r$ empty spots inbetween them.I was thinking - choose $m$ seats out of $m+r$ to put the people on => $\binom{m+r}{m}$ Arrange them once you've chosen the seats $\to (m-1)!$ So in total: $\binom{m+r}{m} \cdot (m-1)!$ This is obviously not true. What's wrong with the way I'm thinking?
13151
LaTeX commands like this:  Here again, four different simulations are run on networks of size  $C^{G} = 25 \times\ 25 = 625$, $C^{G} = 50 \times\ 50 = 2500$, $C^{G} = 250 \times\ 250 = 62500$, and $C^{G} = 500 \times\ 500 = 250000$...   When compiled generate the following:    The spacing in math mode really irritates me. There's too much white space around the equal sign, and the multiplication sign has more right padding than left padding. Is there any way to reduce this spacing?
117148
In how many ways can the letters of word $PERMUTATIONS$ be arranged if there are always $4$ letters between $P$ and $S$?   Now there are $12$ blank spaces, which we have to fill by the letters of the given word.  That is :-  [][][][][][][][][][][][]  it is given that two places are always filled with P and S such that there are 4 blank spaces between them.  {[P][][][][][S]}[][][][][][]  $Therefore$,  the number of arrangements that can be made such that there are 4 letter between $P$ and $S$ is $P(10,4)$  $p(10, 4) = \frac{10!}{(10 - 4)!} =\frac{10!}{6!} = 10 \times 9 \times 8 \times 7 = 5040 \tag 1$  Also {[P][][][][][S]} can be arranged in different ways with respect to {[P][][][][][S]}[][][][][][].  $Therefore$ the number arrangements will be $p(7, 7)$  $p(7, 7,) = 7! = 5040 \tag 2$  $Therefore$ the the total number of arrangements for the given question will be   $5040 \times 5040 \text{ (results of 1 and 2)}\\ = 25401600 \tag3$  but there are two T's in the word permutation  $Therefore$ we divde the result of 3 by 2 to get the real answer.  That is , $$\frac{25401600}{2} = 12700800$$  So I am getting $12700800$ as the answer but it is wrong the given answer is $25401600$. How ?    Thanks and sorry for the formatting.
65662
Is there any way to distribute spacing equally in every object?    Is there any option to do? I want 2MM spacing in every geometrical shape.  Thanks in advance.
86214
I have a document, where I want to use $\tau_{ff}$. If this is rendered it looks like a space is inserted between the two f's. $\tau_{rl}$ looks fine ...   Where does this additional space come from and how can I avoid it being inserted?  (Miktex 2.9 on windows, if this is relevant).
76587
This is a followup question to egreg's answer to  The answer runs into a problem if an index topic occurs in more than one page range. The following MWE, based on egreg's answer:  \begin{filecontents*}{subjind.ist} delim_0 ", \\checkrange{" delim_t "}" \end{filecontents*}  \documentclass{book} \usepackage{xparse} \usepackage{imakeidx}  \makeindex[title=Subject Index,options=-s subjind]  \ExplSyntaxOn \NewDocumentCommand{\checkrange}{&gt;{\SplitArgument{1}{--}}m}  {   \formatrange#1  } \NewDocumentCommand{\formatrange}{mm}  {   \IfNoValueTF { #2 }    { % no --, it's not a range     #1    }    { % it's a range     \egreg_range:nn { #1 } { #2 }    }  }  \bool_new:N \l__egreg_range_compare_bool  \cs_new_protected:Nn \egreg_range:nn  {   % print the start number   #1--   \int_compare:nNnTF { \str_count:n { #1 } } = { \str_count:n { #2 } }    {% same number of digits, remove equal ones at the start     \__egreg_range_compare:nn { #1 } { #2 }    }    {% different number of digits, print both     #2    }  } \cs_new_protected:Nn \__egreg_range_compare:nn  {   \bool_set_true:N \l__egreg_range_compare_bool   % do a loop on the digits in the first number   \int_step_inline:nn { \str_count:n { #1 } }    {     \bool_if:NTF \l__egreg_range_compare_bool      {       % if the digits coincide, print nothing       \str_if_eq:eeF { \str_item:nn { #1 } { ##1 } } { \str_item:nn { #2 } { ##1 } }        {         \str_item:nn { #2 } { ##1 }         % at the first differing digit, don't compare any longer         \bool_set_false:N \l__egreg_range_compare_bool        }      }      { \str_item:nn { #2 } { ##1 } }    }  } \ExplSyntaxOff  \begin{document} \setcounter{page}{95}\index{Topic0|(}Text\newpage \setcounter{page}{101}\index{Topic0|)}Text\newpage \setcounter{page}{124}\index{Topic1|(}\index{Topic2|(}Text\newpage \setcounter{page}{126}\index{Topic1|)}Text\newpage \setcounter{page}{134}\index{Topic2|)}Text\newpage \setcounter{page}{141}\index{Topic0}Text\newpage \index{Topic0}Text\newpage \index{Topic0}Text \printindex \end{document}   yields the following error message:  ! LaTeX3 Error: Too many '--' tokens when trying to split argument.  For immediate help type H &lt;return&gt;.  ...                                                l.3   \item Topic0, \checkrange{95--101, 141--143}   Entering non-stop yields the following output:    which omits "-3" from the second index entry of Topic0. The question is how to get around this.  Edit following up on egreg's ingenious solution.  I don't know if I should ask a new follow up question, so I'm posing it first here in this edit.  egreg's solution doesn't seem to handle index sub-topics.  If one adds the following 4 lines  \setcounter{page}{135}\index{Topic0!sub0|(}Text\newpage \setcounter{page}{136}\index{Topic0!sub0!subsub0|(}Text\newpage \setcounter{page}{139}\index{Topic0!sub0!subsub0|)}Text\newpage \setcounter{page}{140}\index{Topic0!sub0|)}Text\newpage   after  \setcounter{page}{134}\index{Topic2|)}Text\newpage   in the solution, one gets the following errors:  Output written in mwe.ind. Transcript written in mwe.ilg.  (mwe.ind ! Extra }, or forgotten \endgroup. l.4     \subitem sub0, 135--140}  ? r OK, entering \nonstopmode... ! Extra }, or forgotten \endgroup. l.5       \subsubitem subsub0, 136--139}  ) [145] (mwe.aux) )   and this output:    Alas I don't understand egreg's code well enough to make the required changes.
53354
\documentclass[english]{article} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage{babel} \begin{document} % ... \[ \begin{array}{ccccc} x(1) &amp; = &amp; \frac{x(0)}{1} &amp; = &amp; x(0)\\ x(2) &amp; = &amp; \frac{x(1)}{2} &amp; = &amp; \frac{x(0)}{2}\\ x(3) &amp; = &amp; \frac{x(2)}{3} &amp; = &amp; \frac{x(0)}{2.3}\\ x(4) &amp; = &amp; \frac{x(3)}{4} &amp; = &amp; \frac{x(0)}{4!}\\  &amp;  &amp;  &amp;  &amp; \vdots\\ x(n) &amp; = &amp; \frac{x(n-1)}{n} &amp; = &amp; \frac{x(0)}{n!} \end{array} \] % ... \end{document}   Because of the fractions in the array cells, array elements are vertically too close to each other, they are literally touching to each other. Also the horizontal spacing is too much as you see in the image (screen shot from the output PDF file).  How do I make these cell-spacings look better?
11230
I wonder if single multinomial distribution (I will use the notation from JAGS/WinBUGS, but in fact, this is principial thing rather than of particular language)  x[] ~ dmulti(p[], N)   would give the same result as a sequence of binomial draws:  x[1] ~ dbin(p[1], N) x[2] ~ dbin(p[2]/(1 - p[1]), N - x[1]) x[3] ~ dbin(p[3]/(1 - p[1] - p[2]), N - x[1] - x[2]) ... x[K] &lt;- N - x[1] - x[2] - ... - x[K - 1]   Is it totally equivalent? Or did I miss something?
10190
As far as I can understand this should draw the same set of five edges in exactly the same way.  The first set of edges are positioned correctly.  But the second set of edges is horribly aligned.  On my screen, of the \foreach edges, the bottom horizontal one is shifted to the right, the others seems to start ok and then end up further from the center of the pentagon then they should.  Aside from wondering how to fix the alignment, I would also love to understand why this only happens inside a \foreach.  I can "solve" this by first drawing the nodes with minimum size=0mm, and then at the very end redrawing them with 2mm, but that seems less than optimal...  \documentclass{beamer}  \usepackage{calc,ifthen} \usepackage{amsthm,amsmath,amssymb} \usepackage{tikz}  \begin{document}  \frame{ \begin{tikzpicture} \def\r{2cm}  \foreach \t in {0,...,4} {   \node[circle,draw, outer sep=0mm, inner sep=0mm, minimum size=2mm] (a\t) at ({90+\t*72}:\r) {} ; }  % draw the edges of the pentagon in a silly way % draws edges from node-center to node-center \draw (a0) edge (a1) ; \draw (a1) edge (a2) ; \draw (a2) edge (a3) ; \draw (a3) edge (a4) ; \draw (a4) edge (a0) ;  % draw the edges of the pentagon in a better way % draws edges from node-something to node-something-else \foreach \t in {0,...,4} {   \pgfmathsetmacro{\s}{mod(\t+1,5)}   \draw (a\t) edge (a\s) ; }  \end{tikzpicture} }  \end{document}
19281
Consider the following piece of Markdown code:  This is some regular text.      &gt;&gt;&gt; def factorial(n):     ...     return 1 if n &lt; 2 else n * factorial(n - 1)     ...   * This is a list item.      &gt;&gt;&gt; def factorial(n):     ...     return 1 if n &lt; 2 else n * factorial(n - 1)     ...    Notice that the second code block is preceded by a list item.   Why is the factorial code not properly formatted under these circumstances? To demonstrate the problem, I'll insert the Markdown code show above:    This is some regular text.  &gt;&gt;&gt; def factorial(n): ...     return 1 if n &lt; 2 else n * factorial(n - 1) ...     This is a list item                 def factorial(n):       ...     return 1 if n &lt; 2 else n * factorial(n - 1)       ...               This applies to numbered as well as unnumbered lists.
101482
When I type "1." or "10." in Word, it auto generates bullet properly as follows:    But when I change its value to three digits it gets extra indent which definitely looks bad :    I have to manually reindent it. This is big issue when say I have list of 150 numeric bullets. I have to manually reindent them. Plus when I insert new bullet between 1 to 99, 99th bullet gets promoted to value 100 and automatically gets extra indent. Consider what will happen when I insert 10 new bullets at current bullet 20. So current bullet numbers 90 to 99 will get promooted to 100 to 109 and will eventually end up getting extra indent. And am more prone to reindent the stuff. So I suddently realize that my 50+ bullet points got messed up with extra indent.  How can I fix automatic extra indent provided to bullets of length more than 3 digits?
12670
Can someone explain me this  please I am a bit confused?  It's from a texbook I am reading (block cipher companion)  it says that:      each weak key has  $2^{32}$ fixed points $m$ where $\operatorname{DES}_w(m) = m$ ( $w$ is a DES weak key). In other words encrypting a fixed point gives exactly the same point. To see this consider the $2^{32}$ ciphertexts after 8 rounds of encryption for which the two 32 bit halves are equal. For a weak  DES key, the round keys of the eighth and ninth rounds are equal. Thus the intermediate texts after seven rounds and after nine rounds of encryption will be equal. Since the round keys of the 7th and the 10th rounds are equal, the intermediate texts after 6 rounds and after 10 rounds of encryption will be equal. Continuing like this it follows that the plaintext will be equal to the ciphertext.    Now did not quite get :   Why are there $2^{32}$ fixed points?  And why after the eighth round of encryption the two halves must be equal? What does the author mean by the intermediate texts exactly? And how are they being equal?   P.S.: This question is not asking for what the weak keys are. I am asking for "fixed points" not exactly weak keys. For this reason I think it is not a duplicate of any other question. There is one similar question to what I've asked for which I have checked and saw that no satisfactory answer has been given there either.  Here is the similar question with no proper answers:
15709
I want to print two files in two columns -- first file on the left side and second on the right side. paste doesn't do the job, because it can only insert a character as delimiter, so if first file lines have different length output will be twisted: $ cat file1 looooooooong line line $ cat file2 hello world $ paste file1 file2 looooooooong line   hello line    world  If it was a command to add trailing spaces like fmt --add-spaces --width 50 the problem would be solved: $ paste &lt;(fmt --add-spaces --width 50 file1) file2 looooooooong line                                 hello line                                              world  But I don't know a simple way to do this. So how to merge and print several files horizontally without twisting? Actually, I just want to look at them simultaneously.  UPD: command to add trailing spaces does exist (for example, xargs -d '\n' printf '%-50s\n') But solution like $ paste &lt;(add-trailing-spaces file1) file2  does not work as expected when file1 has fewer lines than file2.