<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://metabolomics.jp/mediawiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://metabolomics.jp/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Aritalab%3ALecture%2FAlgorithm%2FTowers_of_Hanoi</id>
		<title>Aritalab:Lecture/Algorithm/Towers of Hanoi - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://metabolomics.jp/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Aritalab%3ALecture%2FAlgorithm%2FTowers_of_Hanoi"/>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;action=history"/>
		<updated>2026-05-17T20:02:50Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=314813&amp;oldid=prev</id>
		<title>Adm at 08:18, 21 August 2016</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=314813&amp;oldid=prev"/>
				<updated>2016-08-21T08:18:29Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 08:18, 21 August 2016&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;必要手数の解&lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;必要な手数&lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;この問題を解くには漸化式（ぜんかしき）を使います。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;この問題を解くには漸化式（ぜんかしき）を使います。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 2 枚の円盤があるとき T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2 + 1 = 3 回、&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 2 枚の円盤があるとき T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2 + 1 = 3 回、&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 3 枚の円盤があるとき T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 3 * 2 + 1 = 7 回&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 3 枚の円盤があるとき T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 3 * 2 + 1 = 7 回&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* 4 枚の円盤があるとき T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 7 * 2 + 1 = 15 回&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* 5 枚の円盤があるとき T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 15 * 2 + 1 = 31 回&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;の移動が必要なことを確認しましょう。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;の移動が必要なことを確認しましょう。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ここで手数を計算するテクニックとして &lt;/del&gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;/2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt; とおきます。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===手数の解法===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;必要な移動の数に 1 を足すと、2, 4, 6, 8, 16, 32 のように 2 の階乗から 1 を引いた数になっています。だから答えは&amp;#160; 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt; - 1 です。これを数式を用いて解いてみましょう。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;手数を計算するテクニックとして &lt;/ins&gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;/2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt; とおきます。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 4 枚の円盤があるとき S&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 15 / 2&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; = 15/16&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 4 枚の円盤があるとき S&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 15 / 2&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; = 15/16&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 5 枚の円盤があるとき S&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 31 / 2&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt; = 31/32&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 5 枚の円盤があるとき S&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 31 / 2&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt; = 31/32&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;分子は分母の数よりちょうど 1 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;だけ小さい数ですね。これを数学的に解くには等比数列の和の公式を利用します。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;分子は分母の数よりちょうど 1 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;だけ小さい数です。これを数学的に解くには等比数列の和の公式を利用します。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;: S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; + 2&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; + ... 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;: S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; + 2&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; + ... 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=314716&amp;oldid=prev</id>
		<title>Adm at 03:52, 6 August 2015</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=314716&amp;oldid=prev"/>
				<updated>2015-08-06T03:52:38Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:52, 6 August 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;===必要手数の解===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;この問題を解くには漸化式（ぜんかしき）を使います。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;この問題を解くには漸化式（ぜんかしき）を使います。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;n (&amp;gt;0) 枚の円盤を移動する手数を T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; と書きます。上から n-1 枚の円盤をまず B の棒に移し、一番大きい円盤を C に移してから、B にある n-1 枚をもう一度全て C に移せばよいので、以下の漸化式を得ます。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;n (&amp;gt;0) 枚の円盤を移動する手数を T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; と書きます。上から n - 1 枚の円盤をまず B の棒に移し、一番大きい円盤を C に移してから、B にある n - 1 枚をもう一度全て C に移せばよいので、以下の漸化式を得ます。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;n+1&amp;lt;/sub&amp;gt; = 2 T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + 1 (n &amp;gt; 0)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;n+1&amp;lt;/sub&amp;gt; = 2 T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + 1 (n &amp;gt; 0)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 3 枚の円盤があるとき T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 3 * 2 + 1 = 7 回&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 3 枚の円盤があるとき T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 3 * 2 + 1 = 7 回&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;の移動が必要なことを確認しましょう。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;の移動が必要なことを確認しましょう。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ここでS&lt;/del&gt;&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;/2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;とおきます。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ここで手数を計算するテクニックとして S&lt;/ins&gt;&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;/2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt; とおきます。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 2 枚の円盤があるとき S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3 / 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; = 3/4&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 2 枚の円盤があるとき S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3 / 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; = 3/4&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 3 枚の円盤があるとき S&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 7 / 2&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 7/8&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 3 枚の円盤があるとき S&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 7 / 2&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 7/8&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;となっています。分母が分子よりも常に大きいので 1 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;より少し小さい数になっています。続けていくと、規則性がわかるでしょう。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;となっています。分母が分子よりも常に大きいので 1 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;より少し小さい数です。続けていくと、規則性がわかります。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 4 枚の円盤があるとき S&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 15 / 2&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; = 15/16&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 4 枚の円盤があるとき S&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 15 / 2&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; = 15/16&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 5 枚の円盤があるとき S&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 31 / 2&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt; = 31/32&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 5 枚の円盤があるとき S&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 31 / 2&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt; = 31/32&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:: = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;(1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;) / ( 1 - 1/2 ) = 1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:: = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;(1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;) / ( 1 - 1/2 ) = 1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;従って &lt;/del&gt;T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-1 となります。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;元々の漸化式との関係を使うと &lt;/ins&gt;T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-1 となります。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;上の円盤の動かし方をよくみても、これが円盤を動かすのに最低限必要な手数であることがわかります。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;上の円盤の動かし方をよくみても、これが円盤を動かすのに最低限必要な手数であることがわかります。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;つまりこの数より少ない回数で円盤を動かすことはできません。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;つまりこの数より少ない回数で円盤を動かすことはできません。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;まとめると、 n 枚の円盤を動かすのに最低限必要な手数は 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-1 、つまり n に対して指数的に増加していくことがわかりました。問題のサイズ (つまり n ) が大きくなると、かかる時間は急速に増えていきます。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;まとめると、 n 枚の円盤を動かすのに最低限必要な手数は 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-1 、つまり n に対して指数的に増加していくことがわかりました。問題のサイズ (つまり n ) が大きくなると、かかる時間は急速に増えていきます。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;例えば &lt;/del&gt;8 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;枚の円盤が棒にささっている場合、最短の手数で移動させても &lt;/del&gt;2&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt; - 1 = 255 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;手が必要だということです。面白半分に &lt;/del&gt;20 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;枚の円盤が棒にささっているパズルを作ったら、最短の手数でも 1048576 手、1 &lt;/del&gt;秒に一枚動かしても 12 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;日以上かかります。ウェブ上で画像を検索すると、多くのパズルは7枚か8枚の円盤があるようです。枚数がこれ以上の場合挑戦しないほうが時間を有効に使えそうですね。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===教訓===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;パズルでも規模が大きくなると急速に（指数的に）時間を要する、つまり難しくなる問題があります。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ハノイの塔の場合、 &lt;/ins&gt;8 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;枚の円盤が棒にささっていると最短の手数で移動させても &lt;/ins&gt;2&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt; - 1 = 255 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;手が必要です。 &lt;/ins&gt;20 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;枚の円盤が棒にささっている場合、最短の手数でも 1,048,576 手です。つまり 1 &lt;/ins&gt;秒に一枚動かしても 12 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;日以上かかります。ウェブ上で画像を検索すると、多くのパズルは7枚か8枚の円盤があるようです。枚数がこれ以上の場合、挑戦しないほうが時間を有効に使えそうです。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=304536&amp;oldid=prev</id>
		<title>Adm at 01:06, 25 July 2013</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=304536&amp;oldid=prev"/>
				<updated>2013-07-25T01:06:31Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 01:06, 25 July 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* 常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;この問題を解くには漸化式（ぜんかしき）を使います。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;n (&amp;gt;0) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;枚の円盤を移動する手数をT&lt;/del&gt;&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;と書きます。上からn&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1枚の円盤をまずBの棒に移し、一番大きい円盤をCに移してから、Bにあるn&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1枚をもう一度全てCに移せばよいので、以下の漸化式を得ます。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;n (&amp;gt;0) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;枚の円盤を移動する手数を T&lt;/ins&gt;&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;と書きます。上から n&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1 枚の円盤をまず B の棒に移し、一番大きい円盤を C に移してから、B にある n&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1 枚をもう一度全て C に移せばよいので、以下の漸化式を得ます。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2 T&amp;lt;sub&amp;gt;n&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;-1&lt;/del&gt;&amp;lt;/sub&amp;gt; + 1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;n&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;+1&lt;/ins&gt;&amp;lt;/sub&amp;gt; = 2 T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + 1 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(n &amp;gt; 0)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;実際に&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* 1 枚の円盤があるとき T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1 回、&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* 2 枚の円盤があるとき T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2 + 1 = 3 回、&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* 3 枚の円盤があるとき T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 3 * 2 + 1 = 7 回&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;の移動が必要なことを確認しましょう。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ここでS&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;/2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;とおきます。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ここでS&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;/2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;とおきます。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = S&amp;lt;sub&amp;gt;n&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;-1&lt;/del&gt;&amp;lt;/sub&amp;gt; + 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; (n &amp;gt; 0)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;n&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;+1&lt;/ins&gt;&amp;lt;/sub&amp;gt; = S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + 2&amp;lt;sup&amp;gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/ins&gt;n&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;+1)&lt;/ins&gt;&amp;lt;/sup&amp;gt; (n &amp;gt; 0)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;この漸化式を解くと&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;この式は&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* 1 枚の円盤があるとき S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1 / 2&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* 2 枚の円盤があるとき S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3 / 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; = 3/4&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* 3 枚の円盤があるとき S&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 7 / 2&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 7/8&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;となっています。分母が分子よりも常に大きいので 1 より少し小さい数になっています。続けていくと、規則性がわかるでしょう。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* 4 枚の円盤があるとき S&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 15 / 2&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; = 15/16&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* 5 枚の円盤があるとき S&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 31 / 2&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt; = 31/32&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;分子は分母の数よりちょうど 1 だけ小さい数ですね。これを数学的に解くには等比数列の和の公式を利用します。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;: S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; + 2&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; + ... 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; = 1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;: S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; + 2&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; + ... 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;従って T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1となります。例えば &lt;/del&gt;8 枚の円盤が棒にささっている場合、最短の手数で移動させても 2&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt; - 1 = 255 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;手が必要だということです。ウェブ上で画像を検索すると、多くのパズルは7枚か8枚の円盤があるようですが、枚数がこれ以上の場合挑戦しないほうが時間を有効に使えそうです。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:: = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;(1 + 1/2 + 1/4 + 1/8 ... 2&amp;lt;sup&amp;gt;-(n-1)&amp;lt;/sup&amp;gt;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:: = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;(1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;) / ( 1 - 1/2 ) &lt;/ins&gt;= 1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;従って T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1 となります。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;上の円盤の動かし方をよくみても、これが円盤を動かすのに最低限必要な手数であることがわかります。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;つまりこの数より少ない回数で円盤を動かすことはできません。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;まとめると、 n 枚の円盤を動かすのに最低限必要な手数は 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-1 、つまり n に対して指数的に増加していくことがわかりました。問題のサイズ (つまり n ) が大きくなると、かかる時間は急速に増えていきます。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;例えば &lt;/ins&gt;8 枚の円盤が棒にささっている場合、最短の手数で移動させても 2&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt; - 1 = 255 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;手が必要だということです。面白半分に 20 枚の円盤が棒にささっているパズルを作ったら、最短の手数でも 1048576 手、1 秒に一枚動かしても 12 日以上かかります。ウェブ上で画像を検索すると、多くのパズルは7枚か8枚の円盤があるようです。枚数がこれ以上の場合挑戦しないほうが時間を有効に使えそうですね。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254300&amp;oldid=prev</id>
		<title>Adm: /* ハノイの塔 */</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254300&amp;oldid=prev"/>
				<updated>2011-12-28T09:12:06Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;ハノイの塔&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:12, 28 December 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;台の上に３本の棒が固定されていて、一番左の棒をＡ、真ん中の棒をＢ、一番右の棒をＣとします。Ａにはn枚の円盤がはまっており、円盤は下へいくほど半径が大きくなっています。次のルールに従い、棒Ｂを利用して全ての円盤をＡからＣに移すとき、何回の移動が必要になるでしょうか。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;台の上に３本の棒が固定されていて、一番左の棒をＡ、真ん中の棒をＢ、一番右の棒をＣとします。Ａにはn枚の円盤がはまっており、円盤は下へいくほど半径が大きくなっています。次のルールに従い、棒Ｂを利用して全ての円盤をＡからＣに移すとき、何回の移動が必要になるでしょうか。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/del&gt;一回に一枚の円盤しか動かしてはいけない。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/ins&gt;一回に一枚の円盤しか動かしてはいけない。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/del&gt;常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/ins&gt;常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254299&amp;oldid=prev</id>
		<title>Adm at 09:11, 28 December 2011</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254299&amp;oldid=prev"/>
				<updated>2011-12-28T09:11:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:11, 28 December 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==ハノイの塔==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==ハノイの塔==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;E. &lt;/del&gt;リュカ, 1883) &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;フランスの数学者 エドゥアール &lt;/ins&gt;リュカ &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;によるパズル&lt;/ins&gt;, 1883) &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;台の上に３本の棒が固定されており、一番左の棒をＡ、真ん中の棒をＢ、一番右の棒をＣとする。Ａにはn枚の円盤がはまっており、円盤は下へいくほど半径が大きくなっている。次のルールに従い、棒Ｂを利用して全ての円盤をＡからＣに移すとき、何回の移動が必要になるか。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Image:TowersOfHanoi.jpg|thumb]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;台の上に３本の棒が固定されていて、一番左の棒をＡ、真ん中の棒をＢ、一番右の棒をＣとします。Ａにはn枚の円盤がはまっており、円盤は下へいくほど半径が大きくなっています。次のルールに従い、棒Ｂを利用して全ての円盤をＡからＣに移すとき、何回の移動が必要になるでしょうか。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# 一回に一枚の円盤しか動かしてはいけない。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# 一回に一枚の円盤しか動かしてはいけない。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# 常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# 常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;n (&amp;gt;0) 枚の円盤を移動する手数をT&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;と書く。上からn&lt;/del&gt;-1枚の円盤をまずBの棒に移し、一番大きい円盤をCに移してから、Bにあるn-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1枚をもう一度全てCに移せばよいので、以下の漸化式を得る。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;n (&amp;gt;0) 枚の円盤を移動する手数をT&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;と書きます。上からn&lt;/ins&gt;-1枚の円盤をまずBの棒に移し、一番大きい円盤をCに移してから、Bにあるn-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1枚をもう一度全てCに移せばよいので、以下の漸化式を得ます。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2 T&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + 1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2 T&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ここでS&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;/2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;とおく。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ここでS&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;/2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;とおきます。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = S&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; (n &amp;gt; 0)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = S&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; (n &amp;gt; 0)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;この漸化式を解くと&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;この漸化式を解くと&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;: S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; + 2&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; + ... 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; = 1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;: S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; + 2&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; + ... 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; = 1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;従って T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1となる。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;従って T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1となります。例えば 8 枚の円盤が棒にささっている場合、最短の手数で移動させても 2&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt; - 1 = 255 手が必要だということです。ウェブ上で画像を検索すると、多くのパズルは7枚か8枚の円盤があるようですが、枚数がこれ以上の場合挑戦しないほうが時間を有効に使えそうです。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254298&amp;oldid=prev</id>
		<title>Adm: /* ハノイの塔 */</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254298&amp;oldid=prev"/>
				<updated>2011-12-19T06:23:57Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;ハノイの塔&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 06:23, 19 December 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;この漸化式を解くと&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;この漸化式を解くと&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;: S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; + 2&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; + ... 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; = 1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;: S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; + 2&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; + ... 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; = 1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;従って T&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;sup&lt;/del&gt;&amp;gt;n&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;sup&lt;/del&gt;&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-1となる。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;従って T&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sub&lt;/ins&gt;&amp;gt;n&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sub&lt;/ins&gt;&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-1となる。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254297&amp;oldid=prev</id>
		<title>Adm: moved Aritalab:Lecture/Basic/Towers of Hanoi to Aritalab:Lecture/Algorithm/Towers of Hanoi</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254297&amp;oldid=prev"/>
				<updated>2011-06-01T15:28:04Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/mediawiki/index.php?title=Aritalab:Lecture/Basic/Towers_of_Hanoi&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Aritalab:Lecture/Basic/Towers of Hanoi (page does not exist)&quot;&gt;Aritalab:Lecture/Basic/Towers of Hanoi&lt;/a&gt; to &lt;a href=&quot;/wiki/Aritalab:Lecture/Algorithm/Towers_of_Hanoi&quot; title=&quot;Aritalab:Lecture/Algorithm/Towers of Hanoi&quot;&gt;Aritalab:Lecture/Algorithm/Towers of Hanoi&lt;/a&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:28, 1 June 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254296&amp;oldid=prev</id>
		<title>Adm at 23:48, 27 February 2011</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254296&amp;oldid=prev"/>
				<updated>2011-02-27T23:48:48Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:48, 27 February 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;解&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;n (&amp;gt;0) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;枚の円盤�を移動する手数を��T&lt;/del&gt;&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;と書く。上からn-1枚の円盤をまずBの棒に移し、一番大きい円盤をCに移してから、Bにあるn-1枚をもう一度全てCに移せばよいので、以下の漸化式を得る。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;n (&amp;gt;0) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;枚の円盤を移動する手数をT&lt;/ins&gt;&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;と書く。上からn-1枚の円盤をまずBの棒に移し、一番大きい円盤をCに移してから、Bにあるn-1枚をもう一度全てCに移せばよいので、以下の漸化式を得る。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2 T&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + 1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2 T&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254295&amp;oldid=prev</id>
		<title>Adm: New page: ==ハノイの塔== (E. リュカ, 1883)  台の上に３本の棒が固定されており、一番左の棒をＡ、真ん中の棒をＢ、一番右の棒をＣとする。Ａにはn枚...</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Algorithm/Towers_of_Hanoi&amp;diff=254295&amp;oldid=prev"/>
				<updated>2010-10-18T02:23:51Z</updated>
		
		<summary type="html">&lt;p&gt;New page: ==ハノイの塔== (E. リュカ, 1883)  台の上に３本の棒が固定されており、一番左の棒をＡ、真ん中の棒をＢ、一番右の棒をＣとする。Ａにはn枚...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==ハノイの塔==&lt;br /&gt;
(E. リュカ, 1883) &lt;br /&gt;
台の上に３本の棒が固定されており、一番左の棒をＡ、真ん中の棒をＢ、一番右の棒をＣとする。Ａにはn枚の円盤がはまっており、円盤は下へいくほど半径が大きくなっている。次のルールに従い、棒Ｂを利用して全ての円盤をＡからＣに移すとき、何回の移動が必要になるか。&lt;br /&gt;
# 一回に一枚の円盤しか動かしてはいけない。&lt;br /&gt;
# 常に大きい方の円盤が下になるようにする。（移動の途中で円盤の大小を逆に積んではいけない。）&lt;br /&gt;
&lt;br /&gt;
;解&lt;br /&gt;
n (&amp;gt;0) 枚の円盤�を移動する手数を��T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;と書く。上からn-1枚の円盤をまずBの棒に移し、一番大きい円盤をCに移してから、Bにあるn-1枚をもう一度全てCに移せばよいので、以下の漸化式を得る。&lt;br /&gt;
* T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;br /&gt;
* T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2 T&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + 1&lt;br /&gt;
ここでS&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = T&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;/2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;とおく。&lt;br /&gt;
* S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0&lt;br /&gt;
* S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = S&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; (n &amp;gt; 0)&lt;br /&gt;
この漸化式を解くと&lt;br /&gt;
: S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; + 2&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; + ... 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt; = 1 - 2&amp;lt;sup&amp;gt;-n&amp;lt;/sup&amp;gt;&lt;br /&gt;
従って T&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;S&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;-1となる。&lt;/div&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	</feed>