(The below text version of the notes is for search purposes and convenience. See the PDF version for proper formatting such as bold, italics, etc., and graphics where applicable. Copyright: 2022 Retraice, Inc.)
Re74: Gradients and Partial Derivatives Part 5 (AIMA4e pp. 119-122)
retraice.com
Bringing the algebra back down to numbers.
Air date: Thursday, 8th Dec. 2022, 11:00 PM Eastern/US.
We're focusing on the math and code of AIMA4e^1 right now, December 2022.It is downright sinful to teach the abstract before the concrete. --Z. A. Melzak /- This is in service of our plan to deep-dive the book from Jan.-Jun., 2023. DISCLAIMER: The below mathematics cannot be trusted; it's a student's attempt, not an expert's.
The airport problem beginning with two cities (not to scale with the original map in grey): ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
PIC ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
The distance between two cities:To forget one's purpose is the commonest form of stupidity. /=^2
x-axisdistance alength = 19- 14 = 5 y-axisdistance blength = 13- 6 = 7 | (straight-linedistance)2 clength2 = alength2+ blength2 = ? clength2 = 52+ 72 = ? -- clength2 = 25+ 49 = 74 ° ------ clength2 = SQRT 74- = W ho cares? c = SQRT 74- = W ho cares? length
/-Quoted in Graham et al. (1994), p. vi
/=Always attributed to Nietzsche.^3
Calculating the objective function f for more cities and three airports:
3 2 2 f(x) =f (x1,y1,x2,y2,x3,y3)= \sumi=1 \sumc(-C(xi- xc) + (yi- yc) i
C[i] is "the set of cities whose closest airport (in the state x) is airport i."^4
To get the total f, add, for each of three airports i, the following |C| subtotals: the sum (for each city c whose closest airport is i) of the square of the x-axis difference in their coordinates and the square of the y-axis difference in their coordinates. The order of subtraction doesn't matter because the number is going to be squared and thus result in a positive number.
_
References
Bittinger, M. L., & Ellenbogen, D. J. (2006). Intermediate Algebra: Concepts and Applications. Addison-Wesley, 7th ed. ISBN: 0321233867. Searches: https://www.amazon.com/s?k=0321233867 https://www.google.com/search?q=isbn+0321233867 https://lccn.loc.gov/2004062480
Graham, R., Knuth, D., & Patashnik, O. (1994). Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley Professional, 2nd ed. ISBN: 978-0201558029. Searches: https://www.amazon.com/s?k=9780201558029 https://www.google.com/search?q=isbn+9780201558029 https://lccn.loc.gov/93040325
Russell, S., & Norvig, P. (2020). Artificial Intelligence: A Modern Approach. Pearson, 4th ed. ISBN: 978-0134610993. Searches: https://www.amazon.com/s?k=978-0134610993 https://www.google.com/search?q=isbn+978-0134610993 https://lccn.loc.gov/2019047498
Footnotes
^1 Russell & Norvig (2020).
^2 I said during the livestream that the distance between the two cities would be "half of 74", or "37.5". This is twice wrong: the distance will be SQRT -- 74 ~=8.6, and anyway, half of 74 is 37.
^3 E.g. `The Commonest Form of Stupidity', Carlos Reyes, wsj.com Apr. 29, 2011. But I couldn't find the original quote (I looked). On stupidity, see also Bittinger & Ellenbogen (2006) p. 32: "Five Steps for Problem Solving in Algebra:
Familiarize yourself with the problem.
Translate to mathematical language.
Carry out some mathematical manipulation.
Check your possible answer in the original problem.
State the answer clearly." [bold emphases added]
^4 Russell & Norvig (2020) p. 120.