目录

Contents

  • 魔术农庄1 Magic Farm 1
  • 不变量计算 The calculation of invariants
  • 魔术农庄2 Magic Farm 2
  • 不变量计算 The computation of invariants
  • 后记 Appendix


近来,我在新生群里听说了这样一个有趣的问题。

Recently, I heard an interesting problem in freshmen group.

很久以前,有三种羊,红羊,蓝羊,黄羊。

Long time ago, there were three kinds of animals, say red sheep, blue goat and yellow lamb.

他们住在一个名为『魔术农庄』的农场。

They lived in a farm called Magic Farm.

如果两只不同色羊相撞,那么他们变成第三种颜色。

If two different animals collide, then they will convert into the other one species.

有红蓝黄三色羊各15,19,20只,问最后会不会出现 所有绵羊同色的情况?

There are 15 red sheep, 19 blue goats and 20 yellow lambs respectively. Can all the animals become of same color at the end?

问题的解决基于这样的一个简单的观察。

The solution of this problem is based on the simple observation as follow.

每一次物种的转变,两物种的数量只差$\bmod 3$都是定值。

Each time of convertion of species, the difference of number of any pair of two species is a constant $\bmod 3$.

但是现在,两两的差为$1,1,2\bmod 3$, 所以不论怎么基因突变,都不能有两种数量同时为零。

But now, the differences are $1,1,2\bmod 3$ respectively, so no matter how the gene mutations occur,  there can not have numbers of two species vanishing at the same time.


选择$\bmod 3$并不是巧合,这背后有一些数学,下面要来揭示这一点。

Our choice of $\bmod 3$ is not a coincidence, and there are some mathematics behind it. We will illustrate it in the following context.

记$a,b,c$分别是三种羊,以他们为基张成一个自由Abel群$a\mathbb{Z}+b\mathbb{Z}+c\mathbb{Z}$.

Denote $a,b,c$ by three kinds of animals, consider $a\mathbb{Z}+b\mathbb{Z}+c\mathbb{Z}$, the free abelian group generated by them.

那么任何羊的数量状态都是这个群中的一个元素。

Then any state of anmial's numbers is an element in this group.

鉴于物种的变化,我们商掉关系$a+b-2c, a+c-2b, b+c-2a$.

Taking into the consideration the change of species, we need to module the relation $a+b-2c, a+c-2b, b+c-2a$.

这样,可以转化的状态就在商群中相等了。

Then, two states in which one can convert into the other one are equal in the quotient group.

现在,我们需要一些计算。

Now, we need some calculation.

$$\begin{array}{l}    \quad a\mathbb{Z}+b\mathbb{Z}+c\mathbb{Z}/(a+b-2c, a+c-2b, b+c-2a)     \\ = a\mathbb{Z}+b\mathbb{Z}+(2a-b)\mathbb{Z}/(a+b-2c, a+c-2b, b+c-2a)     \\     = a\mathbb{Z}+b\mathbb{Z}/(a+b-2(2b-a),b+(2b-a)-2a) \\  = a\mathbb{Z}+b\mathbb{Z}/(3a-3b) \\  = a\mathbb{Z}+(b-a)\mathbb{Z}/(3b-3a) \\ = a\mathbb{Z}+(b-a)\mathbb{Z}/3\mathbb{Z}\\ = \mathbb{Z}\oplus \mathbb{Z}/3\mathbb{Z}    \end{array}$$

在此映射下,$a\mapsto (1,0), b\mapsto (1,1), c\mapsto (1,-1)$.

Under this isomorphism, $a\mapsto (1,0), b\mapsto (1,1), c\mapsto (1,-1)$.

所以$15a+19b+20c\mapsto (54, -1)$, 不能等于任何$na,nb,nc$的像。

Therefore  $15a+19b+20c\mapsto (54, -1)$ which cannot equals to any image of $na,nb,nc$.

同时,我们也发现,在这个问题中,有两个不变量,一个是羊的总数,一个是某两种羊数量之差$\bmod 3$.

On top of that, we find that, in this problem, there are two invariants, the one is the total number of animals, and the other one is the difference $\bmod 3$ between certain two species.


下面我们来看一个类似的问题。

Now, we turn to anthor similar problem.

很久以前,有三种羊,红羊,蓝羊,黄羊。

Long time ago, there were three kinds of animal, say red sheep, blue goat and yellow lamb.

他们住在一个名为『魔术农庄』的农场。

They lived in a farm called Magic Farm.

如果两只不同的羊相撞,那么他们合体成另一个物种。

If two distinct animals collide, then they will blend into one animal of the other one species.

有红蓝黄三色羊各15,19,20只,最终会全变成哪种颜色的羊?

There are 15 red sheep, 19 blue goats and 20 yellow lambs respectively. What kind of species will unify the farm at the end?

这个问题显得怪怪的,似乎没有明显的线索显示最终的颜色是确定的。

This problem is weird, because it is not clear that the final color is determined in advance.

如果我们只想知道最后能够是什么样子的,只需有下面的观察。

If we just want to know about one of the possible final stages, the following observation is sufficiant.

如果我们有两只红羊,可以从邻居家借来一只蓝羊,最后可以变成一只蓝羊(然后我们再还回去)。

If we have two red sheep, we can borrow a blue goat from neighbor, then they can finally becomes one blue goat (and we can give it back to our neighbor).

使用这个技巧,我们可以用不同颜色的羊作为引子,两个两个地除去相同颜色的羊。

Using this trick, we can cancell pair by pair of same species ultizing another species as trigger.

最终,15,19,20只变成1,1,0只,于是最终变成的是黄羊。

Finally, 15, 19, 20 becomes 1, 1, 0. So the final species is the yellow lamb.


如果我们沿着上面问题的思路,我们需要作如下计算。

If we follow the clue of the problem above, we need the following computation.

$$\begin{array}{l}    \quad a\mathbb{Z}+b\mathbb{Z}+c\mathbb{Z}/(a+b-c,a+c-b,b+c-a) \\     = a\mathbb{Z}+b\mathbb{Z}+(a+b)\mathbb{Z}/(a+(a+b)-b, b+(a+b)-a) \\     = a\mathbb{Z}/2\mathbb{Z} + b\mathbb{Z}/2\mathbb{Z} \\      \cong \mathbb{Z}/2\mathbb{Z} \oplus \mathbb{Z}/2\mathbb{Z}\end{array}$$

其中$a\mapsto (1,0), b\mapsto (0,1), c\mapsto (1,1)$,所以$15a+19b+20c\mapsto (1,1)$.

Where $a\mapsto (1,0), b\mapsto (0,1), c\mapsto (1,1)$. As a result, $15a+19b+20c\mapsto (1,1)$.

注意到$na\mapsto (n,0), nb\mapsto (0,n), nc\mapsto (n,n)$,所以$15a+19b+20c\equiv nc$,且$n$是奇数。

Note that $na\mapsto (n,0), nb\mapsto (0,n), nc\mapsto (n,n)$, hence $15a+19b+20c\equiv nc$, with $n$ odd.

有时无法判断最终的颜色,即$(0,0)$的情况。

Sometimes, the final speices is not determined, that is the case $(0,0)$.

现在,最后剩下的可能是任何颜色。

Now, the remain kind of animals can be any speices.

不变量令人惊奇地是Klein四元群。

The invariant is amazingly the Klein's group of order 4.

阶数为2的体现已在上面『借羊』的例子中体现。

The fact that the order is 2 is demonstrated in the example of `borrowing a goat'.


原始问题是

The original problem is

有红黄蓝三色绵羊各15 19 20只,两只异色绵羊可以同时变为第三色,问最后会不会出现 所有绵羊同色的情况?

There are 15, 19 and 20 sheep of color red, yellow and blue respectively. Any pair of sheep of different colors can convert into the rest one color simultaneously. Can all the sheep become of same color at the end?

为了趣味起见,我编了一个故事。

To make it of more fun, I made a story.

『类似的问题』是我自己题的。

The `similar problem' is raised by myself.

这个问题的提法启发自给『孔明棋』。可以利用条带状染Klein四元群来确定最终落子位置。

The raising of this problem is inspired by the game `Peg Solitaire' , where we can know the final position by coloring with Klein group in striped pattern.

    a b c    
    b c a    
a b c a b c a
b c a b c a b
c a b c a b c
    c a b    
    a b c    

图片是用powerpoint制作的。

The picture is made by powerpoint.

感谢汤一鸣提供最初的做法,感谢刘奔和我讨论。

Thank for Tang Yiming for his original solution, and for Liu Ben for discussion.

感谢妈妈的水彩笔。

Thank for my mom's markers.

转载于:https://www.cnblogs.com/XiongRuiMath/p/11337439.html

[Bilingual]魔术农庄里的不变量 Invariants in Magic Farm相关推荐

  1. 华为魔术magic2拆机图_荣耀Magic拆解

    两年前的荣耀 Magic2 通过八曲面玻璃机身.智能系统和超级快充为手机行业带来了全新的理念--AI 在系统中的运用.两年后,荣耀终于推出了荣耀 Magic2,这款手机不但继承了一代 Magic 的智 ...

  2. 字母预言卡里的魔术与数学(一)——魔术表演的艺术

    爱学习,勤思考:学数学,玩魔术.欢迎点击头部蓝字关注MatheMagician,这里有你要的奇迹! 自大学以来,就没少在魔术店里买一些道具.随着工作以后自己的时间越来越少,对魔术的广泛兴趣也逐渐收敛到 ...

  3. PHP中的常见魔术方法功能作用及用法实例

    这篇文章主要介绍了PHP中的常见魔术方法功能作用及用法实例,本文讲解了构造函数和析构函数__construct()和__desctruct()以及属性重载(Property Overloading)_ ...

  4. BC之旅(13) — 农庄的残冬

    离开『男人瀑布』,沿着99号公路继续向东北驶进.在从 Pemberton 到 Duffey 之间的一段是平坦的丘陵地带,在公路的两侧看见了农庄,具有加拿大风格的农庄.BC的二月底,农庄里的积雪已经褪去 ...

  5. 魔术表演的核心秘密(五)——障眼法视角下的魔术核心秘密

    早点关注我,精彩不错过! 在上一篇文章中,我们已经介绍完了本系列文章最核心的内容:用有限状态转移机来描述魔术发生的原理.相关内容请戳: 魔术表演的核心秘密(四)--障眼法的状态机描述 魔术表演的核心秘 ...

  6. 关于洗牌的研究(五)——从数学到魔术之印度洗牌

    爱学习,勤思考:学数学,玩魔术.欢迎点击头部蓝字关注MatheMagician,这里有你要的奇迹! 写再前面:本系列作品由MathMagician独家首发,一共有七篇,从数学和魔术两个角度对日常生活中 ...

  7. 对称、群论与魔术(十)——魔术《吉普赛测试》等

    早点关注我,精彩不错过! 在前面的系列文章中,我们从最基本的几何对称的应用开始,讲到了用群描述的抽象的对称性,等价性原理以及用它来设计魔术的案例.之前的那两个作品<tic-tac-toe> ...

  8. 循环、递归与魔术(二)——循环的魔术逻辑浅析与欣赏

    在上一篇中,我们讲了循环和递归的数学和计算机概念,并举例说明其是一种在生活中的无处不在的结构.相关回顾: 循环.递归与魔术(一)--递归与循环的数理逻辑 上期在谈到递归与循环的程序逻辑时,循环遍历树的 ...

  9. php 魔术方法__get,php常用魔术方法

    1.构造函数__construct()和析构函数__desctruct()分别在对象创建和销毁时被调用.对象被"销毁"是指不存在任何对该对象的引用,比如引用该对象的变量被删除(un ...

最新文章

  1. linux mint(Ubuntu、Debian) 18修改环境变量
  2. TreeSet里面放对象,如果同时放入了父类和子类的实例对象,那比较时使用的是父类的compareTo方法,还是使用的子类的compareTo方法,还是抛异常!...
  3. python练习题:列表排序
  4. 三面美团Java岗,尚学堂java马士兵全套
  5. python编写脚本,删除固定用户下的所有表
  6. Java并发编程:同步容器
  7. nginx的反向代理和负载均衡的区别
  8. java se基础巩固实例,Java SE基础巩固(十五):lambda表达式
  9. mysql中字符串和数字的互转函数
  10. spark概念、编程模型和模块概述
  11. Windows server 2003 ××× 配置实例(Site to Site)
  12. html中空格符号以及空格字符实体的总结
  13. outlook打不开怎么办?
  14. Shiro实现多域名登录界面
  15. 计算机技术在企业管理中的应用浅论,浅谈计算机技术在现代企业管理中的应用...
  16. MAC下 Android签名生成keystore
  17. 使用Fiddler抓取app里面的链接
  18. 港科夜闻|香港科技大学与英国思克莱德大学深化研究合作
  19. 解除隐藏已购项目_从AppStore的已购项目中隐藏已经购买的APP
  20. 营收净利大增股价却暴跌 趣店靠什么赢回资本市场的信心?

热门文章

  1. MySQL查询视图View报错
  2. L298N电机驱动使用方法
  3. ei capitan mysql_关于macos:El Capitan升级后Mysql无法正常工作
  4. 计算机组成原理笔记(王道考研) 第五章:中央处理器
  5. 实例四:switch分支选择——实现阶梯式计算
  6. BDTC 2017 | 知识图谱技术背后的应用与实践
  7. DVR_RDK编译报错
  8. 农村污水处理系统方案
  9. python-数据分析与数据可视化(上)
  10. 1550A. Find The Array