{
  "index": "2007-A-3",
  "type": "COMB",
  "tag": [
    "COMB",
    "NT"
  ],
  "difficulty": "",
  "question": "Let $k$ be a positive integer. Suppose that the integers $1, 2, 3,\n\\dots, 3k+1$ are written down in random order. What is the probability\nthat at no time during this process, the sum of the integers that have\nbeen written up to that time is a positive integer divisible by 3? Your\nanswer should be in closed form, but may include factorials.",
  "solution": "Assume that we have an ordering of $1,2,\\dots,3k+1$ such\n  that no initial subsequence sums to $0$ mod $3$. If we omit the\n  multiples of $3$ from this ordering, then the remaining sequence mod\n  $3$ must look like $1,1,-1,1,-1,\\ldots$ or $-1,-1,1,-1,1,\\ldots$.\n  Since there is one more integer in the ordering congruent to $1$ mod\n  $3$ than to $-1$, the sequence mod $3$ must look like\n  $1,1,-1,1,-1,\\ldots$.\n\n  It follows that the ordering satisfies the given condition if and\n  only if the following two conditions hold: the first element in the\n  ordering is not divisible by $3$, and the sequence mod $3$ (ignoring\nzeroes) is of the form $1,1,-1,1,-1,\\ldots$. The two conditions are\n  independent, and the probability of the first is $(2k+1)/(3k+1)$\nwhile the probability of the second is\n$1/\\binom{2k+1}{k}$,\n  since there are $\\binom{2k+1}{k}$ ways to order $(k+1)$ $1$'s and $k$\n  $-1$'s.\n  Hence the desired probability is the product of these two, or\n  $\\frac{k!(k+1)!}{(3k+1)(2k)!}$.",
  "vars": [
    "k"
  ],
  "params": [],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "k": "countk"
      },
      "question": "Let $countk$ be a positive integer. Suppose that the integers $1, 2, 3,\n\\dots, 3countk+1$ are written down in random order. What is the probability\nthat at no time during this process, the sum of the integers that have\nbeen written up to that time is a positive integer divisible by 3? Your\nanswer should be in closed form, but may include factorials.",
      "solution": "Assume that we have an ordering of $1,2,\\dots,3countk+1$ such\n  that no initial subsequence sums to $0$ mod $3$. If we omit the\n  multiples of $3$ from this ordering, then the remaining sequence mod\n  $3$ must look like $1,1,-1,1,-1,\\ldots$ or $-1,-1,1,-1,1,\\ldots$.\n  Since there is one more integer in the ordering congruent to $1$ mod\n  $3$ than to $-1$, the sequence mod $3$ must look like\n  $1,1,-1,1,-1,\\ldots$.\n\n  It follows that the ordering satisfies the given condition if and\n  only if the following two conditions hold: the first element in the\n  ordering is not divisible by $3$, and the sequence mod $3$ (ignoring\nzeroes) is of the form $1,1,-1,1,-1,\\ldots$. The two conditions are\n  independent, and the probability of the first is $(2countk+1)/(3countk+1)$\nwhile the probability of the second is\n$1/\\binom{2countk+1}{countk}$,\n  since there are $\\binom{2countk+1}{countk}$ ways to order $(countk+1)$ $1$'s and $countk$\n  $-1$'s.\n  Hence the desired probability is the product of these two, or\n  $\\frac{countk!(countk+1)!}{(3countk+1)(2countk)!}$.}"
    },
    "descriptive_long_confusing": {
      "map": {
        "k": "tangerine"
      },
      "question": "Let $tangerine$ be a positive integer. Suppose that the integers $1, 2, 3,\n\\dots, 3tangerine+1$ are written down in random order. What is the probability\nthat at no time during this process, the sum of the integers that have\nbeen written up to that time is a positive integer divisible by 3? Your\nanswer should be in closed form, but may include factorials.",
      "solution": "Assume that we have an ordering of $1,2,\\dots,3tangerine+1$ such\n  that no initial subsequence sums to $0$ mod $3$. If we omit the\n  multiples of $3$ from this ordering, then the remaining sequence mod\n  $3$ must look like $1,1,-1,1,-1,\\ldots$ or $-1,-1,1,-1,1,\\ldots$.\n  Since there is one more integer in the ordering congruent to $1$ mod\n  $3$ than to $-1$, the sequence mod $3$ must look like\n  $1,1,-1,1,-1,\\ldots$.\n\n  It follows that the ordering satisfies the given condition if and\n  only if the following two conditions hold: the first element in the\n  ordering is not divisible by $3$, and the sequence mod $3$ (ignoring\nzeroes) is of the form $1,1,-1,1,-1,\\ldots$. The two conditions are\n  independent, and the probability of the first is $(2tangerine+1)/(3tangerine+1)$\nwhile the probability of the second is\n$1/\\binom{2tangerine+1}{tangerine}$,\n  since there are $\\binom{2tangerine+1}{tangerine}$ ways to order $(tangerine+1)$ $1$'s and $tangerine$\n  $-1$'s.\n  Hence the desired probability is the product of these two, or\n  $\\frac{tangerine!(tangerine+1)!}{(3tangerine+1)(2tangerine)!}$. }",
      "confidence": "0.16"
    },
    "descriptive_long_misleading": {
      "map": {
        "k": "nullsize"
      },
      "question": "Let $nullsize$ be a positive integer. Suppose that the integers $1, 2, 3,\n\\dots, 3nullsize+1$ are written down in random order. What is the probability\nthat at no time during this process, the sum of the integers that have\nbeen written up to that time is a positive integer divisible by 3? Your\nanswer should be in closed form, but may include factorials.",
      "solution": "Assume that we have an ordering of $1,2,\\dots,3nullsize+1$ such\n  that no initial subsequence sums to $0$ mod $3$. If we omit the\n  multiples of $3$ from this ordering, then the remaining sequence mod\n  $3$ must look like $1,1,-1,1,-1,\\ldots$ or $-1,-1,1,-1,1,\\ldots$.\n  Since there is one more integer in the ordering congruent to $1$ mod\n  $3$ than to $-1$, the sequence mod $3$ must look like\n  $1,1,-1,1,-1,\\ldots$.\n\n  It follows that the ordering satisfies the given condition if and\n  only if the following two conditions hold: the first element in the\n  ordering is not divisible by $3$, and the sequence mod $3$ (ignoring\nzeroes) is of the form $1,1,-1,1,-1,\\ldots$. The two conditions are\n  independent, and the probability of the first is $(2nullsize+1)/(3nullsize+1)$\nwhile the probability of the second is\n$1/\\binom{2nullsize+1}{nullsize}$,\n  since there are $\\binom{2nullsize+1}{nullsize}$ ways to order $(nullsize+1)$ $1$'s and $nullsize$\n  $-1$'s.\n  Hence the desired probability is the product of these two, or\n  $\\frac{nullsize!(nullsize+1)!}{(3nullsize+1)(2nullsize)!}$. "
    },
    "garbled_string": {
      "map": {
        "k": "qzxwvtnp"
      },
      "question": "Let $qzxwvtnp$ be a positive integer. Suppose that the integers $1, 2, 3, \\dots, 3qzxwvtnp+1$ are written down in random order. What is the probability that at no time during this process, the sum of the integers that have been written up to that time is a positive integer divisible by 3? Your answer should be in closed form, but may include factorials.",
      "solution": "Assume that we have an ordering of $1,2,\\dots,3qzxwvtnp+1$ such\n  that no initial subsequence sums to $0$ mod $3$. If we omit the\n  multiples of $3$ from this ordering, then the remaining sequence mod\n  $3$ must look like $1,1,-1,1,-1,\\ldots$ or $-1,-1,1,-1,1,\\ldots$.\n  Since there is one more integer in the ordering congruent to $1$ mod\n  $3$ than to $-1$, the sequence mod $3$ must look like\n  $1,1,-1,1,-1,\\ldots$.\n\n  It follows that the ordering satisfies the given condition if and\n  only if the following two conditions hold: the first element in the\n  ordering is not divisible by $3$, and the sequence mod $3$ (ignoring\nzeroes) is of the form $1,1,-1,1,-1,\\ldots$. The two conditions are\n  independent, and the probability of the first is $(2qzxwvtnp+1)/(3qzxwvtnp+1)$\nwhile the probability of the second is\n$1/\\binom{2qzxwvtnp+1}{qzxwvtnp}$,\n  since there are $\\binom{2qzxwvtnp+1}{qzxwvtnp}$ ways to order $(qzxwvtnp+1)$ $1$'s and $qzxwvtnp$\n  $-1$'s.\n  Hence the desired probability is the product of these two, or\n  $\\frac{qzxwvtnp!(qzxwvtnp+1)!}{(3qzxwvtnp+1)(2qzxwvtnp)!}$. "
    },
    "kernel_variant": {
      "question": "Let k be a positive integer.  An urn contains the consecutive integers\n\n4,5,6,\\dots ,3k+4.\n\nThe numbers are drawn one at a time without replacement, each draw being taken uniformly at random from those that still remain.  After each draw we record the running (cumulative) sum of the numbers that have appeared up to that moment.\n\nWhat is the probability that none of these partial sums is a positive multiple of 3?\n(Your answer should be given in closed form; factorials are allowed.)",
      "solution": "Throughout we work modulo 3 and use the residues 0,1,−1 (with −1 representing 2 mod 3).\n\n1.  Residue census\nAmong the 3k+1 integers 4,5,6,\\dots ,3k+4 there are\n   •  k+1 numbers \\equiv 1 (mod 3),\n   •  k   numbers \\equiv −1 (mod 3),\n   •  k   multiples of 3.\n\n2.  Multiples of 3 can be discarded\nA multiple of 3 contributes 0 (mod 3) to every partial sum, so deleting all k multiples of 3 neither creates nor destroys a zero residue among the running totals.  After the deletion we are left with 2k+1 numbers whose residues consist of k+1 ones and k minus-ones.\n\n3.  The unique admissible residue word\nLet (s_1,\\dots ,s_{2k+1}) with s_j\\in\\{1,−1\\} be the residue sequence of those remaining numbers and put\n   S_j:=s_1+\\cdots+s_j \\pmod{3}\\qquad(1\\le j\\le 2k+1),  \\qquad S_0:=0.\nThe condition we must satisfy is\n   S_j\\ne0\\pmod{3}\\quad\\text{for every }j=1,2,\\dots ,2k+1.\nBecause there is one more 1 than −1, the final sum is S_{2k+1}\\equiv1.\n\nKey observation:  if the current running residue is 1 then adding −1 would give 0, so the next symbol cannot be −1; similarly, if the current running residue is 2(=−1) then adding 1 would give 0, so the next symbol cannot be 1.  Formally\n   S_{j−1}=1  \\;\\Rightarrow\\; s_j=1,         (†)\n   S_{j−1}=2  \\;\\Rightarrow\\; s_j=−1.        (††)\nThe next symbol is therefore completely determined by the current residue.\n\nStart of the word.\n•  Suppose s_1=−1.  Then S_1=2, so by (††) we must also have s_2=−1, hence S_2=1.  After these first two steps the counts are #1 =0, #−1 =2 so\n      (#1)−(#−1)=−2.   (★)\n   From this point on the process is forced to alternate −1,+1,−1,+1, … (rules (†)–(††) with starting residue 1), which changes (#1)−(#−1) by 0 over every pair of symbols and by −1 over the final single symbol if the remaining length is odd.  Consequently the final difference (#1)−(#−1) can never exceed −2, contradicting the required difference +1 between the two counts.  Hence a valid sequence cannot start with −1.\n•  Therefore s_1=1.  Then S_1=1, and by (†) we must also have s_2=1, producing S_2=2; now (††) forces s_3=−1, giving S_3=1, etc.  By induction one obtains the unique residue word\n      1,1,−1,1,−1,1,−1,\\dots ,1,−1   (length 2k+1),\nwhich indeed contains k+1 ones and k minus-ones and never produces a 0 running sum.\nThus the word displayed above is the only admissible residue sequence.\n\n4.  Decomposing the probability\nLet\n   A = {the first drawn number is not a multiple of 3},\n   B = {after deleting the multiples of 3 the residue word equals the unique word found in step 3}.\nWe need P(A\\cap B)=P(A)\\,P(B\\mid A).\n\n4.1  P(A)\nExactly 2k+1 of the 3k+1 numbers are non-multiples of 3, so\n      P(A)= (2k+1)/(3k+1).\n\n4.2  P(B\\mid A)\nCondition on A.  The first (non-zero-residue) number is equally likely to be any of the 2k+1 such numbers, so its residue is\n      1 with probability (k+1)/(2k+1),\n     −1 with probability   k  /(2k+1).\nBecause the admissible word starts with 1, we must begin with residue 1.  After that choice there remain k ones and k minus-ones whose order is still uniformly random; there are \\binom{2k}{k} possible arrangements of these 2k symbols, exactly one of which completes the required word.  Hence\n      P(B\\mid A)= \\dfrac{k+1}{2k+1}\\;\\cdot\\;\\dfrac{1}{\\binom{2k}{k}}.\n\n4.3  Putting everything together\n      P(A\\cap B)= \\dfrac{2k+1}{3k+1}\\;\\cdot\\;\\dfrac{k+1}{2k+1}\\;\\cdot\\;\\dfrac{1}{\\binom{2k}{k}}\n                  = \\dfrac{k+1}{3k+1}\\;\\cdot\\;\\dfrac{k!\\,k!}{(2k)!}\n                  = \\boxed{\\dfrac{k!\\,(k+1)!}{(3k+1)(2k)!}}.\n\n5.  Verification for small k\n•  k=1 (integers 4–7):  direct enumeration gives 6 favourable orderings out of 24; probability 1/4.  The formula yields\n        1!·2! /\\bigl((3·1+1)·2!\\bigr)=2/4=1/4  ✓\n•  k=2 (integers 4–10): enumeration gives 360 favourable orderings out of 5040; probability 1/14.  The formula gives\n        2!·3! /(7·4!) =12/168 =1/14 ✓\n\nTherefore the required probability is\n      k!\\,(k+1)!\\big/\\bigl((3k+1)(2k)!\\bigr).",
      "_meta": {
        "core_steps": [
          "Delete the multiples of 3 so the problem is reduced to a word in the residues 1 and −1 (mod 3).",
          "Observe that there are (k+1) copies of 1 and k copies of −1; the ‘never-zero running sum’ condition forces the unique pattern 1,1,−1,1,−1,… (ballot/Catalan argument in disguise).",
          "The event “first term is not a multiple of 3’’ is independent of the residue-pattern event.",
          "Compute the two probabilities, (2k+1)/(3k+1) for the first event and 1/ C(2k+1,k) for the second, then multiply to get k!(k+1)! /[(3k+1)(2k)!]."
        ],
        "mutable_slots": {
          "slot1": {
            "description": "Concrete labels of the numbers; only their residues modulo 3 are used anywhere in the proof.",
            "original": "1,2,3,…,3k+1"
          },
          "slot2": {
            "description": "Choice of a uniformly random permutation; any selection method that gives every ordering the same probability works just as well.",
            "original": "written down in random order"
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "calculation",
  "iteratively_fixed": true
}