Pool-Ball Triangles
by Kouichi Nakagawa, Dec 9, 2018, 8:39 PM
マーティン・ガードナー(Martin Gardner, 1914 - 2010) がScientific American の 236 巻 4 号 (1977 年 4 月) の「Mathematical Games」というコラムで以下のような問題を紹介しました.
例えば
のボールを用いて
段の三角形を考えた場合は以下のような答えになります.
では
のボールを用いて
段の三角形を考えた場合はどのようになるでしょうか?
左右対称を同一視した場合以下の
通りの解があることが知られています.
これくらいの範囲ならば, 闇雲に勘で数字を当てはめても解けるかも知れません.
しかし
のボールを用いて
段の三角形を考えた場合では大変になってしまいます.
因みにこの場合も
通りの解があることが知られているのですが, 全部探し出すのは勘では至難の業です.
そこで, もう少し数学的に候補を絞って考えてみましょう.
先ほど紹介した
のボールを用いた
段の三角形の場合を例として考えてみます.
まずはじめに, 偶奇性に着目します. 便宜上偶数を
, 奇数を
と置くことにすると
となります.
よって最上段は以下の高々
通りとなります.
しかし, 使う数字は
なので,
と
は各
つずつしか使えません.
これより条件を満たす偶奇の配置は以下の
通りしかないことが分かります.
ここで, 一番大きい数字である
は
以下の数字の差の絶対値では表すことが出来ないので, 最上段に来ることが分かります.
また, 二番目に大きい数字である
は
として作るしかないので,
と同じ最上段か,
と
を隣接させてその間の下(上から
段目) に置くことしか出来ません.
以上より
と
(と
) の位置の候補は以下のようになります.
![\[\begin{array}{ccccc}
6 \ \textup{E} \ 5 & \textup{E} \ 6 \ 5 & \textup{E} \ 6 \ 1 & 6 \ 5 \ \textup{E} & 6 \ 1 \ \textup{E} \\
\textup{E} \ \textup{O} & \textup{E} \ \textup{O} & \textup{E} \ 5 & \textup{O} \ \textup{O} & 5 \ \textup{O} \\
\textup{O} & \textup{O} & \textup{O} & \textup{E} & \textup{E} \\
\textup{Pattern A} & \textup{Pattern B} & \textup{Pattern C} & \textup{Pattern D} & \textup{Pattern E} \\
\end{array}\]](//latex.artofproblemsolving.com/c/7/4/c749953a2ab8f47862e3a6440280ea0e78af1bd0.png)
と
は
が
つしかないのでこの部分には
が入ることが分かります.
残りもそこから自動的に分かり以下のようになります.
残りのパターンは, 最上段の
は
か
なので, 具体的にいれて計算をして, 条件を満たすか確かめます.
すると
と分かり, 以上
つが答えとなります.
これらの問題を単純に総当たりで解こうとすると
段は
なので
通り
段は
なので
通り
段は
なので
通り
段は
なので
通り
段は
なので
通り
段は
なので
通り
と増えていきます.
一方
kB =
byte >
byte
MB =
kB >
byte
GB =
MB >
byte
TB =
GB >
byte
ですので,
段以降の計算では総当たりで調べようにもメモリが足りないので工夫が必要になってきます.
また, CPU が
GHz だとすると, これは
秒間に
G 回 =
回計算出来るということですが,
計算と行っても四則演算(除算に関しては加算・減算・乗算の倍かかる) に過ぎないので, 複雑な計算であればある程より時間がかかります.
ですので, 仮にメモリが沢山あり,
秒間に
パターンのチェックが出来たとしても
段では
秒つまり約
分かかります.
何とか待てる時間ですが, 瞬時ではないですね.
ましてや
段ですと
年ほどかかってしまいます.
やはりそのまま計算するのは現実的ではないですね.
(実際には
秒間に
パターンもチェックできないので,
段でさえ結構時間がかかります.)
しかし今回のように偶奇性に着目して問題にアプローチすれば,
段の場合は
パターンも計算しないですみます.
規則や法則を見抜いて関係性などを見つけることが出来ればこんなにも計算量が減ることが分かります.
「プログラムを組んでパソコンに解かせばそんなことは関係ないではないか!」
という意見もあるかも知れませんが, 大きい数ではメモリが足りなくなったり, 余りにも時間がかかりすぎてしまうことがあります.
ですので, プログラムで問題を解くにしてもパソコンの気持ちになって工夫が必要になります.
問題を解くときは総当たりのように闇雲に問題に挑戦するのではなく, 何か計算をしたり試したりして少しでもできるだけ考えるようにしましょう.
因みに
段の場合の偶奇の配置の候補は
となり, 解は
の
つとなります.
また
段の場合の偶奇の配置の候補は
となり, 解は
の
つだけです.
更に,
段以上に関しては解が存在しないことが証明されています.
Martin Gardner wrote:
Colonel George Sicherman of Buffalo tells me that about
years ago, while he was watching a game of pool, the following problem occurred to him: Is it possible to form a "difference triangle" in arranging the
balls in the usual triangular configuration before the start of a game? In a difference triangle the numbers
through
are arranged in such a way that each number below a pair of numbers is the positive difference between that pair.






![\[\begin{array}{cc}
3 \ 2 & 3 \ 1 \\
1 & 2 \\
\end{array}\]](http://latex.artofproblemsolving.com/d/c/e/dce303f7c73a2e58572c1cdfdcbf593373d8a41b.png)


左右対称を同一視した場合以下の

![\[\begin{array}{cccc}
6 \ 2 \ 5 & 2 \ 6 \ 5 & 6 \ 1 \ 4 & 1 \ 6 \ 4 \\
4 \ 3 & 4 \ 1 & 5 \ 3 & 5 \ 2 \\
1 & 3 & 2 & 3 \\
\end{array}\]](http://latex.artofproblemsolving.com/9/3/b/93b9ed6108735fcc9dcf29959f27662c963c94b9.png)
しかし


因みにこの場合も

そこで, もう少し数学的に候補を絞って考えてみましょう.
先ほど紹介した


まずはじめに, 偶奇性に着目します. 便宜上偶数を


![\[\begin{cases}
\textup{E} \pm \textup{E} = \textup{O} \pm \textup{O} &= \textup{E} \\
\textup{E} \pm \textup{O} = \textup{O} \pm \textup{E} &= \textup{O} \\
\end{cases}\]](http://latex.artofproblemsolving.com/a/5/0/a504e9bb169de52068029e709f6c6fe684ec5c59.png)
よって最上段は以下の高々

![\[\textup{E}\textup{E}\textup{E} \quad \textup{E}\textup{E}\textup{O} \quad \textup{E}\textup{O}\textup{E} \quad \textup{E}\textup{O}\textup{O} \quad \textup{O}\textup{E}\textup{E} \quad \textup{O}\textup{E}\textup{O} \quad \textup{O}\textup{O}\textup{E} \quad \textup{O}\textup{O}\textup{O}\]](http://latex.artofproblemsolving.com/9/0/5/9051e8d579d182793164700295ec4be9e68cdb44.png)




これより条件を満たす偶奇の配置は以下の

![\[\begin{array}{ccc}
\textup{E} \ \textup{E} \ \textup{O} & \textup{E} \ \textup{O} \ \textup{E} & \textup{O} \ \textup{O} \ \textup{O} \\
\textup{E} \ \textup{O} & \textup{O} \ \textup{O} & \textup{E} \ \textup{E} \\
\textup{O} & \textup{E} & \textup{E} \\
\end{array}\]](http://latex.artofproblemsolving.com/8/d/5/8d5b6293226adb3322a6da1b99683bec1ab75318.png)


また, 二番目に大きい数字である






以上より



![\[\begin{array}{ccccc}
6 \ \textup{E} \ 5 & \textup{E} \ 6 \ 5 & \textup{E} \ 6 \ 1 & 6 \ 5 \ \textup{E} & 6 \ 1 \ \textup{E} \\
\textup{E} \ \textup{O} & \textup{E} \ \textup{O} & \textup{E} \ 5 & \textup{O} \ \textup{O} & 5 \ \textup{O} \\
\textup{O} & \textup{O} & \textup{O} & \textup{E} & \textup{E} \\
\textup{Pattern A} & \textup{Pattern B} & \textup{Pattern C} & \textup{Pattern D} & \textup{Pattern E} \\
\end{array}\]](http://latex.artofproblemsolving.com/c/7/4/c749953a2ab8f47862e3a6440280ea0e78af1bd0.png)





残りもそこから自動的に分かり以下のようになります.
![\[\begin{array}{cc}
4 \ 6 \ 1 & 6 \ 1 \ 4 \\
2 \ 5 & 5 \ 3 \\
3 & 2 \\
\end{array}\]](http://latex.artofproblemsolving.com/1/9/2/192a436735111ec24539b1ba7c7f68cbf9d37222.png)



すると
![\[\begin{array}{cc}
6 \ 2 \ 5 & 2 \ 6 \ 5 \\
4 \ 3 & 4 \ 1 \\
1 & 3 \\
\end{array}\]](http://latex.artofproblemsolving.com/d/7/9/d793e039143f722b89a834fc48ec24173ff902cd.png)

これらの問題を単純に総当たりで解こうとすると


















と増えていきます.
一方












ですので,

また, CPU が




計算と行っても四則演算(除算に関しては加算・減算・乗算の倍かかる) に過ぎないので, 複雑な計算であればある程より時間がかかります.
ですので, 仮にメモリが沢山あり,





何とか待てる時間ですが, 瞬時ではないですね.
ましてや


やはりそのまま計算するのは現実的ではないですね.
(実際には



しかし今回のように偶奇性に着目して問題にアプローチすれば,


規則や法則を見抜いて関係性などを見つけることが出来ればこんなにも計算量が減ることが分かります.
「プログラムを組んでパソコンに解かせばそんなことは関係ないではないか!」
という意見もあるかも知れませんが, 大きい数ではメモリが足りなくなったり, 余りにも時間がかかりすぎてしまうことがあります.
ですので, プログラムで問題を解くにしてもパソコンの気持ちになって工夫が必要になります.
問題を解くときは総当たりのように闇雲に問題に挑戦するのではなく, 何か計算をしたり試したりして少しでもできるだけ考えるようにしましょう.
因みに

![\[\begin{array}{ccc}
\textup{E} \ \textup{E} \ \textup{O} \ \textup{E} & \textup{E} \ \textup{E} \ \textup{O} \ \textup{O} \ & \textup{E} \ \textup{O} \ \textup{E} \ \textup{O} \\
\textup{E} \ \textup{O} \ \textup{O} & \textup{E} \ \textup{O} \ \textup{E} & \textup{O} \ \textup{O} \ \textup{O} \\
\textup{O} \ \textup{E} & \textup{O} \ \textup{O} & \textup{E} \ \textup{E} \\
\textup{O} & \textup{E} & \textup{E} \\
\end{array}\]](http://latex.artofproblemsolving.com/6/0/d/60d5b991b232ab2e1566b20f15fd0c7a83c23a01.png)
![\[\begin{array}{cccc}
6 \ 10 \ 1 \ 8 & 8 \ 10 \ 1 \ 6 & 8 \ 3 \ 10 \ 9 & 8 \ 10 \ 3 \ 9 \\
4 \ 9 \ 7 & 2 \ 9 \ 5 & 5 \ 7 \ 1 & 2 \ 7 \ 6 \\
5 \ 2 & 7 \ 4 & 2 \ 6 & 5 \ 1 \\
3 & 3 & 4 & 4 \\
\end{array}\]](http://latex.artofproblemsolving.com/c/1/d/c1da660560ef1963b92130e5a01ca9e4c1e21d6f.png)

また

![\[\begin{array}{ccccc}
\textup{E} \ \textup{E} \ \textup{O} \ \textup{E} \ \textup{O} & \textup{E} \ \textup{E} \ \textup{O} \ \textup{O} \ \textup{O} & \textup{E} \ \textup{O} \ \textup{O} \ \textup{O} \ \textup{O} & \textup{O} \ \textup{E} \ \textup{E} \ \textup{E} \ \textup{O} & \textup{O} \ \textup{E} \ \textup{E} \ \textup{O} \ \textup{O} \\
\textup{E} \ \textup{O} \ \textup{O} \ \textup{O} & \textup{E} \ \textup{O} \ \textup{E} \ \textup{E} & \textup{O} \ \textup{E} \ \textup{E} \ \textup{E} & \textup{O} \ \textup{E} \ \textup{E} \ \textup{O} & \textup{O} \ \textup{E} \ \textup{O} \ \textup{E} \\
\textup{O} \ \textup{E} \ \textup{E} & \textup{O} \ \textup{O} \ \textup{E} & \textup{O} \ \textup{E} \ \textup{E} & \textup{O} \ \textup{E} \ \textup{O} & \textup{O} \ \textup{O} \ \textup{O} \\
\textup{O} \ \textup{E} & \textup{E} \ \textup{O} & \textup{O} \ \textup{E} & \textup{O} \ \textup{O} & \textup{E} \ \textup{E} \\
\textup{O} & \textup{O} & \textup{O} & \textup{E} & \textup{E} \\
\end{array}\]](http://latex.artofproblemsolving.com/1/4/1/1418c91ccab9d55269e1b5e25e98c568cb37a181.png)
![\[\begin{array}{c}
6 \ 14 \ 15 \ 3 \ 13 \\
8 \ 1 \ 12 \ 10 \\
7 \ 11 \ 2 \\
4 \ 9 \\
5 \\
\end{array}\]](http://latex.artofproblemsolving.com/1/6/2/162d6a2b76a834528fba8ce4b7f8f8b2c3235296.png)

更に,

This post has been edited 2 times. Last edited by Kouichi Nakagawa, Dec 9, 2018, 9:10 PM
Reason: Revision by CPU part.
Reason: Revision by CPU part.