
上QQ阅读APP看书,第一时间看更新
第2章 极限
2-1 从金门高粱酒说起
2-1-1 稀释金门高粱酒的酒精浓度
金门高粱酒的酒精浓度是58%,如果倒掉半瓶然后加入等量的水,这时金门高粱酒的酒精浓度变成29%,如果一直重复此步骤,高粱酒的酒精浓度会持续降低,如下所示:
58%, 29%, 14.5%, …
假设金门高粱酒酒精浓度的变量是y(单位:%),则最开始y=58,假设稀释酒精次数是x,则可以使用下列函数代表此高粱酒的酒精稀释的过程与结果:

程序实例ch2_1.py:在上述高粱酒的酒精稀释的过程中,计算当酒精稀释次数x从0至10的酒精浓度的变化过程。

执行结果

程序实例ch2_2.py:重新设计ch2_1.py,使用图表方式表达。

执行结果

从前面2个程序实例可以看到,当x 值(稀释金门高粱酒的酒精浓度的次数)越来越大时,甚至趋近于无限大时,y 值(酒精的浓度)将越来越小,y=0.00…001,最后趋近于0。