做测试 登录 English
← 练习 561 →
搜索
跳转
找到 {{searchResults.length}} 条与“{{searchWords}}”相关的结果 没有找到与“{{searchWords}}”相关的结果 × 返回目录
目录 · 按章节
基础计数 (147)
球与盒子 (6)
概率 (142)

练习及解答

练习 561
For each positive integer $n$, let $S(n)$ be the number of sequences of length $n$ consisting solely of the letters $A$ and $B$, with no more than four $A$s in a row and no more than four $B$s in a row. What is the remainder when $S(2016)$ is divided by $12$?
← 返回第 561 题
解答
  1. A sequence is determined by its first letter ($2$ choices) and its run lengths, each $1$, $2$, $3$, or $4$. So $S(n)=2T(n)$, where $T(n)$ is the number of ways to write $n$ as an ordered sum of $1$s, $2$s, $3$s, and $4$s.
  2. With $T(0)=1$, $T(1)=1$, $T(2)=2$, $T(3)=4$, we have $T(n)=T(n-1)+T(n-2)+T(n-3)+T(n-4)$ (look at the last part). The first values are $T(1),\dots,T(8)=1,2,4,8,15,29,56,108$.
  3. We need $T(2016)\bmod 6$. Modulo $2$, the values $T(1),T(2),\dots$ are $1,0,0,0,1,\ 1,0,0,0,1,\dots$ with period $5$ (the $4$ previous values $1,0,0,0$ repeat). Since $2016\equiv1\pmod5$, $T(2016)\equiv T(1)=1\pmod2$.
  4. Modulo $3$, the values $T(1),\dots,T(26)$ are
    \[
    1,2,1,2,0,2,2,0,1,2,2,2,1,\ 1,0,1,0,2,0,0,2,1,0,0,0,1,
    \]
    and then $T(27),\dots,T(30)\equiv1,2,1,2$ again, so the period is $26$. Since $2016=26\cdot77+14$, $T(2016)\equiv T(14)\equiv1\pmod3$.
  5. So $T(2016)\equiv1\pmod6$ and $S(2016)=2T(2016)\equiv\boxed{2}\pmod{12}$.
搜索 跳转 上一题      下一题

联系我们

谢谢!您的消息已发送。
按年份