-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patherrata.html
More file actions
166 lines (158 loc) · 8.04 KB
/
errata.html
File metadata and controls
166 lines (158 loc) · 8.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="Pelican" />
<title>Errata</title>
<link rel="stylesheet" href="../theme/css/main.css" />
<link href="http://doingmathwithpython.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Doing Math with Python Atom Feed" />
</head>
<body id="index" class="home">
<header id="banner" class="body">
<h1><a href="../">Doing Math with Python</a></h1>
<nav><ul>
<li><a href="../pages/about.html">About</a></li>
<li><a href="../pages/software-installation.html">Software Installation</a></li>
<li><a href="../pages/programs.html">Programs</a></li>
<li class="active"><a href="../pages/errata.html">Errata</a></li>
<li><a href="../pages/help.html">Help</a></li>
<li><a href="../pages/buy.html">Buy</a></li>
<li><a href="../pages/reviews.html">Reviews</a></li>
</ul></nav>
</header><!-- /#banner -->
<section id="content" class="body">
<h1 class="entry-title">Errata</h1>
<div class="section" id="chapter-2">
<h2>Chapter 2</h2>
<p>On Page 47, in the second last sentence of the second last paragraph, the book currently states "The x-axis of the
graph displays the force, and the y-axis displays the distance.". It should be "The x-axis of the graph displays the distance
and the y-axis displays force".</p>
<p>(Thanks to Mike Beasley for pointing this out)</p>
<p>On Page 48, Figure 2-12 caption should be "Figure 2-12: Visualization of the relationship between the gravitational force and
the distance" and not "..squared distance".</p>
<p>On Page 52, in the paragraph starting with "In this program...", the book currently states,
".. we calculate the time of flight and then call the frange() function with the values for start, final, and
increment set to 0,". "increment" should be "interval".</p>
<p>(Thanks to a lovely Japanese reader for pointing this out).</p>
</div>
<div class="section" id="chapter-3">
<h2>Chapter 3</h2>
<p>On Page 77, in the program for finding the correlation coefficient, the last <cite>for</cite> loop has an extra space infront of
it. It should be:</p>
<pre class="code literal-block">
..
y_square = []
for yi in y:
y_square.append(yi**2)
...
</pre>
<p>(Thanks to Elmar Bucher for pointing this out)</p>
<p>On Page 87, the book refers to the Google Correlate service. However, as of December 2019,
the service has been shutdown. Since the chapter requires you to download a CSV formatted data,
it is no longer possible. However, you can instead download a version of the data that I had
used 5 years back when writing the book from <a class="reference external" href="https://github.com/doingmathwithpython/code/blob/master/chapter3/solutions/correlate-summer.csv">here</a>.</p>
<p>(Thanks to Tuomo Kalliokoski)</p>
</div>
<div class="section" id="chapter-4">
<h2>Chapter 4</h2>
<p>On page 97, in the section "Factorizing and Expanding Expressions", the
expand function should be imported before we can use it via
<tt class="docutils literal">from sympy import expand</tt>.</p>
<p>On page 99, in the code snippet on Line (2) and the following, the indentation is wrong.
It should be:</p>
<pre class="code literal-block">
for i in range(2, n+1):
series = series + (x**i)/i
</pre>
<p>(Thanks to Taylan Yemliha)</p>
<p>On page 112, an import is missing - <cite>SympifyError</cite> used later in the
<cite>try..except</cite> block. The initial import statement should hence be:</p>
<pre class="code literal-block">
from sympy import Symbol, sympify, solve, SympifyError
</pre>
<p>(Thanks to Robert Buckley for pointing it out)</p>
<p>On page 115, in the first paragram, "using the first letter of the color.." is not correct for black, since we use <cite>k</cite>
for <cite>black</cite> color.</p>
<p>(Thanks to Elmar Bucher for pointing this out)</p>
</div>
<div class="section" id="chapter-5">
<h2>Chapter 5</h2>
<p>On page 132, in the section "Probability", the program should start
with the import statment <tt class="docutils literal">from sympy import FiniteSet</tt>. (Thanks to
Dexter Edge)</p>
<p>On page 132, in the section "Probability," the code line above the one
marked with a (3), which reads <tt class="docutils literal">for num in s:</tt> should instead read:
<tt class="docutils literal">for num in space</tt>.</p>
<p>On page 135, in "Can You Roll That Score?" there is no need for <cite>import matplotlib.pyplot as plt</cite>.</p>
<p>(Thanks to Elmar Bucher for the above)</p>
<p>On page 139, in the code for simulating a fictional ATM, the statement
<tt class="docutils literal">probability = [1/6, 1/6, 1/3, 2/3]</tt> should be <tt class="docutils literal">probability = [1/6,
1/6, 1/3, 1/3]</tt>. (Thanks to Luis Soares)</p>
</div>
<div class="section" id="chapter-6">
<h2>Chapter 6</h2>
<p>On page 164 and 165, the transformation equations have some errors in the text
(not in the program). The equations should be:</p>
<p><strong>Transformation 1</strong></p>
<p>x1 = 0.85*x + 0.04*y</p>
<p>y1 = -0.04*x + 0.85*y + 1.6</p>
<p><strong>Transformation 2</strong></p>
<p>x1 = 0.2*x - 0.26*y</p>
<p>y1 = 0.23*x + 0.22*y + 1.6</p>
<p><strong>Transformation 3</strong></p>
<p>x1 = -0.15*x + 0.28*y</p>
<p>y1 = 0.26*x + 0.24*y + 0.44</p>
<p><strong>Transformation 4</strong></p>
<p>x1 = 0</p>
<p>y1 = 0.16*y</p>
<p>(Thanks to Dexter Edge, Fatih Kürşat Cansu, Toshiaki Kurokawa and Twitter @mkamimura)</p>
</div>
<div class="section" id="chapter-7">
<h2>Chapter 7</h2>
<p>On page 195, an import is missing - <cite>SympifyError</cite> used later in the
<cite>try..except</cite> block. The initial import statement should hence be:</p>
<pre class="code literal-block">
from sympy import Derivative, Symbol, sympify, SympifyError
</pre>
<p>(Thanks to Robert Buckley for pointing it out)</p>
<p>On page 204, in the first paragraph, the first property should be "..the function value for x is always greater then or equal 0".</p>
<p>(Thanks to Elmar Bucher for pointing this out)</p>
</div>
<div class="section" id="appendix-b">
<h2>Appendix B</h2>
<p>On page 226, in "Multiple Return Values", the code snippet to call the <cite>components()</cite>
functions should be:</p>
<pre class="code literal-block">
if __name__ == '__main__':
u = 5
theta = math.radians(45)
x, y = components(u, theta)
</pre>
<p>(Thanks to a reader for pointing it out)</p>
</div>
</section>
<section id="extras" class="body">
<div class="social">
<h2>social</h2>
<ul>
<li><a href="http://doingmathwithpython.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate">atom feed</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
Proudly powered by <a href="https://getpelican.com/">Pelican</a>, which takes great advantage of <a href="https://www.python.org/">Python</a>.
</address><!-- /#about -->
<p>The theme is by <a href="https://www.smashingmagazine.com/2009/08/designing-a-html-5-layout-from-scratch/">Smashing Magazine</a>, thanks!</p>
</footer><!-- /#contentinfo -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-67534179-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>