美文网首页大数据Aha数学极简的数学(数学的极简美学)
麦当劳里的丢番图方程 Linear Diophantine Eq

麦当劳里的丢番图方程 Linear Diophantine Eq

作者: 不连续小姐 | 来源:发表于2019-03-09 05:45 被阅读1次

数论课里, Dr.Cavior 讲过一个真的故事,

One Sunday morning 🌞, he just made a cup of freshly brewed coffee☕ and started to read a book 📒, then he got a call from a friend ☎. The friend was asking for his help with a 1 Million Dollars McDonald's Puzzle that she was trying for couple days!
一个星期天的早上,他煮开一壶咖啡,准被看书,然后接到一个朋友的电话,要他帮忙解一个麦当劳1百万美金的数学题。

The 1 Million Dollar Puzzle was using any integer coefficients to make a sum of 100 with 3, 48, 6, 21, 33, 18, 36, 12, 60. ✍

用3, 48, 6, 21, 33, 18, 36, 12, 60这几个数找到和等于100 的整数解,

[caption id="attachment_1803" align="alignnone" width="750"] L

andreas160578 / Pixabay[/caption]

Dr. Cavior 写下这几个数的时候就笑了, 因为他知道没有整数解。

Dr.Cavior 怎么能这么快知道答案? 秘密就是 Linear Diophantine Equation! 丢番图方程

We will go over the basic theorem of GCD(greatest common divisor) and Diophantine Linear Equation now.

  • Linear Diophantine Equation 丢番图

Simple Form: ax+by=c, where a, b, and c are integers
General Form: ax1+bx2+cx3+dx4.....=m, where a,b,c.. are integer coefficients.

  • Greatest Common Divisor 最大公约数

    d is the greatest common divisor of integers a and b if d is the largest positive integer which divides both a and b.
    Notation d= gcd(a,b)
    Example 4=gcd(8,12)

  • Linear Diophantine Equation Solution Theorem 丢番图方程定理

    For any Non-zero Integer a and b, ax+by=c, there exist integer solutions if and only if c|gcd(a,b).
    More generally, a1x1+a2x2+a3x3+.... anxn=m, there exist integer solution if and only if m|gcd(a1,a2,...an)
    丢番图方程有解当且仅当 m 被最大公约数整除。

回到百万美金赏题 3, 48, 6, 21, 33,18,36,12,60. the greatest common divisor of these number is 3, which is not divisible by 100, so this is no solutions, 这些数的最大公约数是3,不能被100整除,所以没有解

我们用python 来算一下最大公约数!

def find_gcd(x,y):
    while(y):
        x,y =y , x%y
    return x
l=[3,6,18,21]
num1=l[0]
num2=l[1]
gcd=find_gcd(num1,num2)
for i in range(2, len(l)):
    gcd=find_gcd(gcd,l[i])
print(gcd)

3

I still remember Dr. Cavior said it is pretty Wicked for McDonald's to put down puzzles like that! :)

image

I m reading Dr.费曼's book, he described "他眼中有一束幸福的光. "
我很喜欢这个句子, 因为我看见过, 就是 Dr.Cavior 讲数论的时候的眼神!

Next time we will go over how to solve the Linear Diophantine Equations!

Happy Number Theory Learning!

image

Reference:
Dr.Cavior's Note
https://www.geeksforgeeks.org/gcd-two-array-numbers/

相关文章

  • 麦当劳里的丢番图方程 Linear Diophantine Eq

    数论课里, Dr.Cavior 讲过一个真的故事, One Sunday morning ?, he just m...

  • Python3 欧拉计划 问题66-70

    66、丢番图方程   考虑如下形式的二次丢番图方程:      x2 – Dy2 = 1举例而言,当D=13时,x...

  • 学习笔记《Diophantine equation》

    在学习数论的时候,看到居然有可以描述素数的丢番图方程,这个世界真的好奇妙~ 这个方程是 Jones et al. ...

  • 01.数论

    【数论】 数论是纯粹数学的分支之一,主要研究整数的性质。整数可以是方程式的解(丢番图方程)。有些解析函数(像黎曼ζ...

  • 2017-11-23

    7.连分数,丢番都方程(不定方程) 1).形如a=a。+1/ a1+1...

  • 书籍汇集

    《丢番图的算数》——求解方程a²+b²=c²,找到能让其成立的整数a.b.c。 《几何原本》——欧几里得 《数学原...

  • 算法学习(2)----丢番图方程

    之前一篇随笔"算法学习(1)----扩展欧几里得算法"记录了对朴素欧几里得算法和扩展欧几里得算法的学习和认识...

  • 丢番图谜题

    被誉为代数之父的丢番图, 他的墓志铭是一道多项式: 上帝给予的童年站了六分之一,又过了十二分之一,两颊长胡,再过七...

  • (6)神经网络算法(NN)

    1、关于非线性转化方程(non-linear transformation function) sigmoid函数...

  • 无标题文章

    关于非线性转化方程(non-linear transformation function) sigmoid函数(S...

网友评论

    本文标题:麦当劳里的丢番图方程 Linear Diophantine Eq

    本文链接:https://www.haomeiwen.com/subject/wvmjpqtx.html