Pongeponge

『変な計算』をちょっとやってみた

fraction piecesfraction pieces / jimmiehomeschoolmom

数学の秘密の本棚

数学の秘密の本棚

この本に出てきた問題の一つにこんなのがあった。

そこには、
\(\frac{1}{4}\times\frac{8}{5}=\frac{18}{45}\)
と書いてあった。するとヘンリーが、「でも先生、どこが間違っているんですか?電卓で検算したら合ってました」と口答えした。*1

 このヘンリーがやったように分母どうし、分子どうしで単純にくっつけただけで式が成立するような、そんな組み合わせをすべて見つけよ、という問題。

 とりあえず整理してみると、
\(\frac{a}{b}\times\frac{c}{d}=\frac{10a+c}{10b+d}\)
\(\frac{ac}{bd}=\frac{10a+c}{10b+d}\)
\(ac(10b+d)=bd(10a+c)\)
こうなる。

 めんどくさいのでC#で計算してみると、やたら沢山でてきた。
a=b,c=dになってるもの(\(\frac{a}{a}\times\frac{c}{c}=\frac{ac}{ac}=1\)になる)を除外すると、

\(\frac{1}{2}\times\frac{5}{4}=\frac{15}{24}\)
\(\frac{1}{4}\times\frac{8}{5}=\frac{18}{45}\)
\(\frac{1}{6}\times\frac{4}{3}=\frac{14}{63}\)
\(\frac{1}{6}\times\frac{6}{4}=\frac{16}{64}\)
\(\frac{1}{9}\times\frac{9}{5}=\frac{19}{95}\)
\(\frac{2}{1}\times\frac{4}{5}=\frac{24}{15}\)
\(\frac{2}{6}\times\frac{6}{5}=\frac{26}{65}\)
\(\frac{4}{1}\times\frac{5}{8}=\frac{45}{18}\)
\(\frac{4}{9}\times\frac{9}{8}=\frac{49}{98}\)
\(\frac{6}{1}\times\frac{3}{4}=\frac{63}{14}\)
\(\frac{6}{1}\times\frac{4}{6}=\frac{64}{16}\)
\(\frac{6}{2}\times\frac{5}{6}=\frac{65}{26}\)
\(\frac{9}{1}\times\frac{5}{9}=\frac{95}{19}\)
\(\frac{9}{4}\times\frac{8}{9}=\frac{98}{49}\)
全部で14個。

 見てると不思議なのは、前の分数に3,5,7,8が、後ろの分数に1,2,7が出てこない。
なぜその数字が表れないのかはわからない(素数になって通分できなくなるからとか?)

 ついでに3項バージョンもやってみることにした。*2
式は、
\(\frac{a}{b}\times\frac{c}{d}\times\frac{e}{f}=\frac{100a+10c+e}{100b+10d+f}\)
さっきと同じようにa=b,c=d,e=fを除外して総当たり合戦。

\(\frac{1}{1}\times\frac{3}{4}\times\frac{5}{4}=\frac{135}{144}\)
\(\frac{1}{1}\times\frac{3}{8}\times\frac{8}{4}=\frac{138}{184}\)
\(\frac{1}{1}\times\frac{4}{3}\times\frac{4}{5}=\frac{144}{135}\)
\(\frac{1}{1}\times\frac{4}{8}\times\frac{8}{5}=\frac{148}{185}\)
\(\frac{1}{1}\times\frac{8}{3}\times\frac{4}{8}=\frac{184}{138}\)
\(\frac{1}{1}\times\frac{8}{4}\times\frac{5}{8}=\frac{185}{148}\)
\(\frac{1}{2}\times\frac{1}{3}\times\frac{6}{2}=\frac{116}{232}\)
\(\frac{1}{2}\times\frac{2}{1}\times\frac{4}{7}=\frac{124}{217}\)
\(\frac{1}{2}\times\frac{6}{6}\times\frac{5}{4}=\frac{165}{264}\)
\(\frac{1}{2}\times\frac{7}{6}\times\frac{8}{7}=\frac{178}{267}\)
\(\frac{1}{2}\times\frac{8}{4}\times\frac{3}{4}=\frac{183}{244}\)
\(\frac{1}{2}\times\frac{8}{4}\times\frac{6}{8}=\frac{186}{248}\)
\(\frac{1}{3}\times\frac{2}{4}\times\frac{9}{4}=\frac{129}{344}\)
\(\frac{1}{3}\times\frac{3}{4}\times\frac{8}{5}=\frac{138}{345}\)
\(\frac{1}{3}\times\frac{6}{2}\times\frac{1}{2}=\frac{161}{322}\)
\(\frac{1}{3}\times\frac{6}{2}\times\frac{2}{4}=\frac{162}{324}\)
\(\frac{1}{3}\times\frac{6}{2}\times\frac{3}{6}=\frac{163}{326}\)
\(\frac{1}{3}\times\frac{6}{2}\times\frac{4}{8}=\frac{164}{328}\)
\(\frac{1}{3}\times\frac{8}{4}\times\frac{4}{5}=\frac{184}{345}\)
\(\frac{1}{4}\times\frac{4}{3}\times\frac{5}{5}=\frac{145}{435}\)
\(\frac{1}{4}\times\frac{6}{4}\times\frac{8}{8}=\frac{168}{448}\)
\(\frac{1}{4}\times\frac{6}{9}\times\frac{4}{2}=\frac{164}{492}\)
\(\frac{1}{4}\times\frac{8}{2}\times\frac{3}{7}=\frac{183}{427}\)
\(\frac{1}{4}\times\frac{8}{6}\times\frac{6}{5}=\frac{186}{465}\)
\(\frac{1}{4}\times\frac{9}{9}\times\frac{8}{5}=\frac{198}{495}\)
\(\frac{1}{5}\times\frac{2}{2}\times\frac{6}{5}=\frac{126}{525}\)
\(\frac{1}{6}\times\frac{2}{1}\times\frac{3}{5}=\frac{123}{615}\)
\(\frac{1}{6}\times\frac{2}{7}\times\frac{8}{2}=\frac{128}{672}\)
\(\frac{1}{6}\times\frac{6}{6}\times\frac{6}{4}=\frac{166}{664}\)
\(\frac{1}{7}\times\frac{2}{6}\times\frac{7}{2}=\frac{127}{762}\)
\(\frac{1}{7}\times\frac{6}{8}\times\frac{8}{4}=\frac{168}{784}\)
\(\frac{1}{7}\times\frac{8}{4}\times\frac{7}{8}=\frac{187}{748}\)
\(\frac{1}{8}\times\frac{8}{1}\times\frac{2}{9}=\frac{182}{819}\)
\(\frac{1}{9}\times\frac{3}{7}\times\frac{9}{3}=\frac{139}{973}\)
\(\frac{1}{9}\times\frac{4}{4}\times\frac{7}{5}=\frac{147}{945}\)
\(\frac{1}{9}\times\frac{9}{9}\times\frac{9}{5}=\frac{199}{995}\)
\(\frac{2}{1}\times\frac{1}{2}\times\frac{7}{4}=\frac{217}{124}\)
\(\frac{2}{1}\times\frac{3}{1}\times\frac{2}{6}=\frac{232}{116}\)
\(\frac{2}{1}\times\frac{4}{8}\times\frac{4}{3}=\frac{244}{183}\)
\(\frac{2}{1}\times\frac{4}{8}\times\frac{8}{6}=\frac{248}{186}\)
\(\frac{2}{1}\times\frac{6}{6}\times\frac{4}{5}=\frac{264}{165}\)
\(\frac{2}{1}\times\frac{6}{7}\times\frac{7}{8}=\frac{267}{178}\)
\(\frac{2}{3}\times\frac{8}{7}\times\frac{8}{8}=\frac{288}{378}\)
\(\frac{2}{4}\times\frac{1}{3}\times\frac{6}{2}=\frac{216}{432}\)
\(\frac{2}{4}\times\frac{4}{2}\times\frac{4}{7}=\frac{244}{427}\)
\(\frac{2}{4}\times\frac{4}{6}\times\frac{8}{5}=\frac{248}{465}\)
\(\frac{2}{5}\times\frac{7}{7}\times\frac{6}{5}=\frac{276}{575}\)
\(\frac{2}{6}\times\frac{6}{6}\times\frac{6}{5}=\frac{266}{665}\)
\(\frac{2}{6}\times\frac{8}{8}\times\frac{5}{4}=\frac{285}{684}\)
\(\frac{2}{7}\times\frac{7}{2}\times\frac{3}{8}=\frac{273}{728}\)
\(\frac{2}{9}\times\frac{1}{8}\times\frac{8}{1}=\frac{218}{981}\)
\(\frac{2}{9}\times\frac{3}{4}\times\frac{6}{4}=\frac{236}{944}\)
\(\frac{3}{1}\times\frac{2}{6}\times\frac{2}{1}=\frac{322}{161}\)
\(\frac{3}{1}\times\frac{2}{6}\times\frac{4}{2}=\frac{324}{162}\)
\(\frac{3}{1}\times\frac{2}{6}\times\frac{6}{3}=\frac{326}{163}\)
\(\frac{3}{1}\times\frac{2}{6}\times\frac{8}{4}=\frac{328}{164}\)
\(\frac{3}{1}\times\frac{4}{2}\times\frac{4}{9}=\frac{344}{129}\)
\(\frac{3}{1}\times\frac{4}{3}\times\frac{5}{8}=\frac{345}{138}\)
\(\frac{3}{1}\times\frac{4}{8}\times\frac{5}{4}=\frac{345}{184}\)
\(\frac{3}{2}\times\frac{7}{8}\times\frac{8}{8}=\frac{378}{288}\)
\(\frac{3}{4}\times\frac{1}{2}\times\frac{8}{4}=\frac{318}{424}\)
\(\frac{3}{4}\times\frac{2}{9}\times\frac{8}{2}=\frac{328}{492}\)
\(\frac{3}{6}\times\frac{1}{3}\times\frac{6}{2}=\frac{316}{632}\)
\(\frac{3}{6}\times\frac{6}{3}\times\frac{4}{7}=\frac{364}{637}\)
\(\frac{3}{7}\times\frac{1}{4}\times\frac{8}{2}=\frac{318}{742}\)
\(\frac{3}{8}\times\frac{2}{7}\times\frac{7}{2}=\frac{327}{872}\)
\(\frac{4}{1}\times\frac{2}{8}\times\frac{7}{3}=\frac{427}{183}\)
\(\frac{4}{1}\times\frac{3}{4}\times\frac{5}{5}=\frac{435}{145}\)
\(\frac{4}{1}\times\frac{4}{6}\times\frac{8}{8}=\frac{448}{168}\)
\(\frac{4}{1}\times\frac{6}{8}\times\frac{5}{6}=\frac{465}{186}\)
\(\frac{4}{1}\times\frac{9}{6}\times\frac{2}{4}=\frac{492}{164}\)
\(\frac{4}{1}\times\frac{9}{9}\times\frac{5}{8}=\frac{495}{198}\)
\(\frac{4}{2}\times\frac{2}{4}\times\frac{7}{4}=\frac{427}{244}\)
\(\frac{4}{2}\times\frac{3}{1}\times\frac{2}{6}=\frac{432}{216}\)
\(\frac{4}{2}\times\frac{6}{4}\times\frac{5}{8}=\frac{465}{248}\)
\(\frac{4}{3}\times\frac{2}{1}\times\frac{4}{8}=\frac{424}{318}\)
\(\frac{4}{3}\times\frac{9}{2}\times\frac{2}{8}=\frac{492}{328}\)
\(\frac{4}{5}\times\frac{5}{4}\times\frac{5}{6}=\frac{455}{546}\)
\(\frac{4}{7}\times\frac{1}{2}\times\frac{2}{1}=\frac{412}{721}\)
\(\frac{4}{7}\times\frac{2}{4}\times\frac{4}{2}=\frac{424}{742}\)
\(\frac{4}{7}\times\frac{3}{6}\times\frac{6}{3}=\frac{436}{763}\)
\(\frac{4}{7}\times\frac{4}{8}\times\frac{8}{4}=\frac{448}{784}\)
\(\frac{4}{8}\times\frac{1}{3}\times\frac{6}{2}=\frac{416}{832}\)
\(\frac{4}{8}\times\frac{8}{4}\times\frac{4}{7}=\frac{484}{847}\)
\(\frac{4}{9}\times\frac{9}{9}\times\frac{9}{8}=\frac{499}{998}\)
\(\frac{5}{1}\times\frac{2}{2}\times\frac{5}{6}=\frac{525}{126}\)
\(\frac{5}{2}\times\frac{7}{7}\times\frac{5}{6}=\frac{575}{276}\)
\(\frac{5}{4}\times\frac{4}{5}\times\frac{6}{5}=\frac{546}{455}\)
\(\frac{5}{6}\times\frac{4}{5}\times\frac{5}{4}=\frac{545}{654}\)
\(\frac{6}{1}\times\frac{1}{2}\times\frac{5}{3}=\frac{615}{123}\)
\(\frac{6}{1}\times\frac{6}{6}\times\frac{4}{6}=\frac{664}{166}\)
\(\frac{6}{1}\times\frac{7}{2}\times\frac{2}{8}=\frac{672}{128}\)
\(\frac{6}{2}\times\frac{6}{6}\times\frac{5}{6}=\frac{665}{266}\)
\(\frac{6}{2}\times\frac{8}{8}\times\frac{4}{5}=\frac{684}{285}\)
\(\frac{6}{3}\times\frac{3}{1}\times\frac{2}{6}=\frac{632}{316}\)
\(\frac{6}{3}\times\frac{3}{6}\times\frac{7}{4}=\frac{637}{364}\)
\(\frac{6}{5}\times\frac{5}{4}\times\frac{4}{5}=\frac{654}{545}\)
\(\frac{6}{8}\times\frac{1}{2}\times\frac{8}{4}=\frac{618}{824}\)
\(\frac{7}{1}\times\frac{4}{8}\times\frac{8}{7}=\frac{748}{187}\)
\(\frac{7}{1}\times\frac{6}{2}\times\frac{2}{7}=\frac{762}{127}\)
\(\frac{7}{1}\times\frac{8}{6}\times\frac{4}{8}=\frac{784}{168}\)
\(\frac{7}{2}\times\frac{2}{7}\times\frac{8}{3}=\frac{728}{273}\)
\(\frac{7}{3}\times\frac{4}{1}\times\frac{2}{8}=\frac{742}{318}\)
\(\frac{7}{4}\times\frac{2}{1}\times\frac{1}{2}=\frac{721}{412}\)
\(\frac{7}{4}\times\frac{4}{2}\times\frac{2}{4}=\frac{742}{424}\)
\(\frac{7}{4}\times\frac{6}{3}\times\frac{3}{6}=\frac{763}{436}\)
\(\frac{7}{4}\times\frac{8}{4}\times\frac{4}{8}=\frac{784}{448}\)
\(\frac{8}{1}\times\frac{1}{8}\times\frac{9}{2}=\frac{819}{182}\)
\(\frac{8}{3}\times\frac{7}{2}\times\frac{2}{7}=\frac{872}{327}\)
\(\frac{8}{4}\times\frac{3}{1}\times\frac{2}{6}=\frac{832}{416}\)
\(\frac{8}{4}\times\frac{4}{8}\times\frac{7}{4}=\frac{847}{484}\)
\(\frac{8}{6}\times\frac{2}{1}\times\frac{4}{8}=\frac{824}{618}\)
\(\frac{9}{1}\times\frac{4}{4}\times\frac{5}{7}=\frac{945}{147}\)
\(\frac{9}{1}\times\frac{7}{3}\times\frac{3}{9}=\frac{973}{139}\)
\(\frac{9}{1}\times\frac{9}{9}\times\frac{5}{9}=\frac{995}{199}\)
\(\frac{9}{2}\times\frac{4}{3}\times\frac{4}{6}=\frac{944}{236}\)
\(\frac{9}{2}\times\frac{8}{1}\times\frac{1}{8}=\frac{981}{218}\)
\(\frac{9}{4}\times\frac{9}{9}\times\frac{8}{9}=\frac{998}{499}\)
Count:118

 一気に増えた…。
一応、\(\frac{3}{3}\),\(\frac{7}{9}\),\(\frac{9}{7}\)が無いのはわかってる。


 なんか法則性みたいなものが分かれば面白いんだけどな。


使ったソースコードはこちら。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int max = 9;
            int start = 1;
            int count = 0;
            int a, b, c, d, e, f;

            for (a = start; a <= max; a++)
            {
                for(b = start; b <= max; b++)
                {
                    for(c = start; c <= max; c++)
                    {
                        for (d = start; d <= max; d++)
                        {
                            for (e = start; e <= max; e++)
                            {
                                for (f = start; f <= max; f++)
                                {
                                    if (a == b && c == d && e == f) break;

                                    int r1 = a * c * e * (100 * b + 10 * d + f);
                                    int r2 = b * d * f * (100 * a + 10 * c + e);

                                    if (r1 == r2)
                                    {
                                        int ru = 100 * a + 10 * c + e;
                                        int rd = 100 * b + 10 * d + f;

                                        string s = string.Format(@"\(\frac{{{0}}}{{{1}}}\times\frac{{{2}}}{{{3}}}\times\frac{{{4}}}{{{5}}}=\frac{{{6}}}{{{7}}}\)", a, b, c, d, e, f, ru, rd);
                                        
                                        Debug.WriteLine(s);
                                        count++;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            Debug.WriteLine("Count:" + count);
        }
    }
}

分数ができない大学生―21世紀の日本が危ない

分数ができない大学生―21世紀の日本が危ない

*1:イアン・スチュアート,水谷淳 (2012). 数学の秘密の本棚 p.183

*2:やりすぎは美徳