为了账号安全,请及时绑定邮箱和手机立即绑定

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

数论课里, 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

点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消