1999年03月15日

まあ基本だけどねふふふん

「じぶん更新日記」の偽金貨検出問題を読んで、Santa Rosa に来てすぐの頃を懐かしく思い出してしまった。会社の同僚数人との食事中、まさにその問題が話題に出たのだ。

「12枚のコインがある。この内1枚だけ重さの違う偽物が混ざっている。それが他のコインより重いか軽いかは分からない。天秤を3回だけ使って、どのコインが偽物か、それは重いか軽いかを当てるにはどうしたら良いか」

エンジニアは、基本的に頭脳労働者だ。それはつまり、ある程度は「こいつは頭がいい」と思ってもらわないことには同僚として尊重されない。いや、少なくとも「こいつは馬鹿ではないな」と思ってもらう必要がある。

では、その頃僕はどう思われていたか。まず、日本から来たらしい。若いので、経験はそんなに無さそうだ。話をすると、たどたどしい英語をひどいアクセントで、つっかえながら、自信無さそうに話す。時々何を言っているのかさえ分からない。つまり、普通はこんな人を「頭がいい」と思うのは非常に難しい。

そんな時に出てきたのが、この問題だった。その問題を解いて見せ、更に「3回天秤を使うことで何枚まで判別できるか?」の問題の考え方について説明した。それでいきなりすべてが変わったわけではないが、以前より技術的な討論をする機会が多くなった。そして数学的パズルが有効だと分かった僕は、その後もいろんな人にパズルを出題し、出されたものを解いて見せ、信頼を勝ち得た(?)のだ。

↓パズルの細かい内容に興味ない人はここで投票ボタンを押して下さい。有難うございます。


どうやって、何枚まで判別できるかを知るのか。

天秤を1回使うとき、予想される結果は3通りある。
1.右が下がる 2.左が下がる 3.釣り合う
つまり、もともとあった可能な答の数を、1回の試行で(ベストケースで)3分の1まで減らすことが出来る。たとえば2枚のコインA、Bがあった時、可能な答は3つある。
1.Aが重い 2.Bが重い 3.同じ重さ
これを1回の試行で、1つに絞りこむことが出来る。

では2回の試行ではどうなるか。それぞれの試行には3通りの結果があり、そのコンビネーションになるので、3×3で9分の1まで絞りこめる。つまり、最大で9通りの答のバリエーションがある問題まで解くことが出来る。たとえば「9枚のコインがあり、そのうち1枚だけが他のものより重い。天秤を2回使って...」といった問題が成立する。その問題の答として考えられるのは、9枚のコインをそれぞれA,B,...,Iとすると、 「コインAが重い」「コインBが重い」…「コインIが重い」の9通りなのである。これよりコインの枚数が多くなると、2回では絶対に不可能なのだ。

3回では、3×3×3で27通りである。最初の問題である「コインが12枚で、偽物が他より重いか軽いか分からない」で可能な答えは、「コインAが軽い」「コインAが重い」「コインBが軽い」「コインBが重い」…「コインLが軽い」「コインLが重い」で、12×2の24通りしかない、解けそうである。実際解ける。

しかし、この考え方だと、コインが13枚でも解けそうである。13×2=26で、27より小さい。が、これは不可能なのだ。

まず、1回目の試行を考えてみよう。両方の皿に4枚ずつ(右の皿にABCD、左の皿にEFGH)乗せてみる。
この時に天秤が傾けば、問題はない。たとえば右の皿が傾いたなら、可能な答は「ABCDのどれかが重い」「EFGHのどれかが軽い」の8通りで、次の試行で3通り、次で1通りに絞りこむことが出来る。ところが釣り合った場合、残ったコインは5枚あり、可能な答は「IJKLMのどれかが重い」「IJKLMのどれかが軽い」の10通りになってしまう。これを2回の試行で絞り込むのは不可能である。それでは、と最初に皿に乗せる枚数を変えても、どれかのケースで必ず10通り以上の答が残ってしまう。

問題の設定によって、きれいに1回の試行で3分の1まで絞りこめることもあれば絞りこめないこともある。この問題の場合、それぞれのコインが3通りの可能解(重い/軽い/他と同じ重さ)を持っており、天秤の上に乗せる時にそれが不可分である(重い可能性だけがあるコインと軽い可能性だけがあるコインに分けられない)ところが問題を複雑にしている。

たとえば「27枚のコインがあり、どれか1枚が必ず重い」とか長谷川さんの最後の問題の「26枚のコインがあり、すべて同じ重さかどれか1枚だけが重い」などの問題は、答が27通り予想され、きれいに
27通り→9通り→3通り→1通り
と3分の1ずつ減らすことが出来る例である。

Trackback on "まあ基本だけどねふふふん"

このエントリーのトラックバックURL: 

"まあ基本だけどねふふふん"へのトラックバックはまだありません。

Comment on "まあ基本だけどねふふふん"

I’d come to consent with you here. Which is not something I usually do! I love reading a post that will make people think. Also, thanks for allowing me to speak my mind!

Hey there, You’ve done an excellent job. I will definitely digg it and personally recommend to my friends. I’m sure they will be benefited from this site.

I¡¯m delighted that I have observed this weblog. Lastly something not a junk, which we go through incredibly frequently. The website is lovingly serviced and saved up to date. So it have to be, thanks for sharing this with us.

Hey – nice blog, just wanting around some blogs, appears a reasonably nice platform You Are using. I’m currently using Drupal for just a few of my sites but seeking to change considered one of them over to a platform very a lot the same to yours as a trial run. Anything specifically you'd recommend about it?

Hello clever points.. now why didn't i consider those? Off subject barely, is this web page sample merely from an ordinary installation or else do you use a custom-made template. I exploit a webpage i’m looking for to enhance and effectively the visuals is probably going one of the key issues to finish on my list.

Hi there clever points.. now why did not i consider these? Off subject slightly, is this web page pattern merely from an peculiar set up or else do you utilize a customized template. I take advantage of a webpage i’m in search of to enhance and well the visuals is probably going one of many key issues to complete on my list.

Now you've your new site and also you’re eager to begin making some gross sales! But, how are you going to make gross sales in case you don't have excessive volumes of holiday makers to your website?

I know this isn’t precisely on subject, but i've a web site utilizing the identical program as effectively and i get troubles with my feedback displaying. is there a setting i'm lacking? it’s potential you may help me out? thanx.

hey all, I used to be simply checkin’ out this blog and I really admire the premise of the article, and have nothing to do, so if anyone would like to to have an engrossing convo about it, please contact me on AIM, my title is heather smith

Highly rated post. I be taught one thing completely new on completely different blogs everyday. Deciding on one . stimulating to read the paper content from different writers and learn slightly one thing from their website. I’d like to apply certain of this content on my weblog you’re mind. Natually I’ll give a link here we're at your web-site. Recognize your sharing.

Good day intelligent points.. now why did not i consider those? Off subject slightly, is that this web page pattern merely from an extraordinary set up or else do you utilize a personalized template. I exploit a webpage i’m looking for to improve and well the visuals is probably going one of the key things to finish on my list.

With the results of the current stressexamination on Hospitals in Europe due out tomorrow it has to be a worrying time for the economy. Let’s hope we’re not headed for another crisis again.

I do know this isn’t precisely on topic, but i have a web page utilizing the identical program as well and i am getting troubles with my feedback displaying. is there a setting i'm lacking? it’s attainable you may assist me out? thanx.

I’d must examine with you here. Which isn't one thing I normally do! I get pleasure from studying a submit that will make folks think. Additionally, thanks for allowing me to remark!

Really like your websites details! Undoubtedly a beautiful offer of knowledge that's extraordinarily helpful. Keep it up to hold publishing and i’m gonna proceed reading by way of! Cheers.

Identify along by using this valuable write-up, My partner and i genuinely believe this process web-site desires a lot much more aspect to consider. I’ll likely often be once again that will study a good deal considerably more, cheers to which will facts.

Hi, I just ran across your blog via google. Your post is truly applicable to my life currently, and I’m really delighted I discovered your website.

It’s exhausting to seek out educated people on this subject, but you sound like you realize what you’re speaking about! Thanks

Please tell me it worked right? I dont need to sumit it once more if i don’t have to! Either the blog glitced out or i am an idiot, the second alternative doesnt surprise me lol. thanks to your beneficial blog!

Hi, I just discovered your website via google. Your viewpoint is truly pertinent to my life currently, and I’m really pleased I discovered your website.

My oh my our added advantages! a amazing content person. Give thanks to anyone Having said that Since i was suffering from challenge with the help of third rss . Don’t recognize reasons why Ineffectual to assist you to sign up to to successfully the item. Might be truth be told there any one obtaining equivalent feed situation? Everybody exactly who has learned i implore you to follow through. Thnkx

Just a fast hello and also to thank you for discussing your ideas on this page. I wound up inside your weblog right after researching physical fitness connected issues on Yahoo… guess I lost track of what I had been performing! Anyway I’ll be back once once more within the future to test out your blogposts down the road. Thanks!

Pretty insightful publish. Never believed that it was this simple after all. I had spent a excellent deal of my time looking for someone to explain this topic clearly and you’re the only 1 that ever did that. Kudos to you! Keep it up

Just a fast hello and also to thank you for discussing your ideas on this web page. I wound up inside your blog right after researching physical fitness connected issues on Yahoo… guess I lost track of what I had been performing! Anyway I’ll be back as soon as once more within the long run to check out your blogposts down the road. Thanks!

Quite insightful submit. Never believed that it was this simple after all. I had spent a superior deal of my time looking for someone to explain this subject clearly and you’re the only one that ever did that. Kudos to you! Keep it up

What i don't realize is actually how you are not really a lot more smartly-liked than you may be now. You are very intelligent. You know therefore significantly in relation to this topic, produced me in my opinion imagine it from a lot of varied angles. Its like men and women are not interested until it¡¦s one thing to accomplish with Lady gaga! Your individual stuffs nice. Always care for it up!

Hi, I just ran across your website via yahoo. Your post is truly pertinent to my life right now, and I’m really pleased I found your website.

Resources such as the a single a person mentioned the following will be very necessary to me! Let me publish a hyperlink to this page in my blog page. I’m comfortable my guests will find that extremely practical.

Hey – nice blog, just wanting around some blogs, seems a reasonably good platform You Are using. I'm presently utilizing Drupal for a few of my websites but seeking to change one in every of them over to a platform very a lot the same to yours as a trial run. Something specifically you'd suggest about it?

This was a definitely very very good submit. In theory I’d wish to write like this also - getting time and actual effort to make a excellent piece of writing… but what can I say… I procrastinate alot and by no means seem to obtain some thing done.

thus far Pepsi has been known for inventing and distributing strangely flavored versions of their well-known Pepsi soda. They’ve experimented with clear, white, clear, red, and now they’re going blue with Pepsi blue.

  •   pepsi
  • 2011年05月05日 17:49

Just a fast hello and also to thank you for discussing your ideas on this page. I wound up in your weblog right after researching physical fitness connected issues on Yahoo… guess I lost track of what I had been performing! Anyway I’ll be back once once more inside the long run to verify out your blogposts down the road. Thanks!

I’d have to concur with you on this. Which is not something I usually do! I enjoy reading a post that will make people think. Also, thanks for allowing me to comment!

Sick! Just obtained a brand-new Pearl and I can now read your blog on my phone’s browser, it didn’t get the job done on my previous one.

I’d be inclined to buy into with you one this subject. Which is not something I usually do! I love reading a post that will make people think. Also, thanks for allowing me to speak my mind!

Sick! Just obtained a brand-new Pearl and I can now read your weblog on my phone’s browser, it didn’t function on my aged one.