{"id":107,"date":"2014-11-14T13:01:48","date_gmt":"2014-11-14T13:01:48","guid":{"rendered":"http:\/\/underthehood.blogwyrm.com\/?p=107"},"modified":"2022-07-28T06:25:38","modified_gmt":"2022-07-28T10:25:38","slug":"a-new-direction-on-vectors","status":"publish","type":"post","link":"https:\/\/underthehood.blogwyrm.com\/?p=107","title":{"rendered":"A New Direction on Vectors"},"content":{"rendered":"<p>This post grew out of a discussion I had with my son who is now learning physics at the high school level.\u00a0 He was reading his text book with the old, time-honored discussion of vectors being things with directions and magnitudes.\u00a0 This is certainly true for physical vectors that describe things like displacement, velocity, force, torque, and electric and magnetic fields \u2013 all the typical menagerie that introductory physics students encounter.<\/p>\n<p>But I couldn\u2019t resist talking to him about vector spaces in general.\u00a0 It has long baffled me why we teach kids from the beginning the dumbed-down version of things then make them unlearn it later on.\u00a0 From what I can tell, the really creative thinkers of history were ones who didn&#8217;t succumb to this mind-numbing nonsense.\u00a0 They were people who didn\u2019t let the accepted way of doing things constrain them.\u00a0 If they had, we would never have heard of them.<\/p>\n<p>Thus I resolved to talk to him about vectors in general.\u00a0 I introduced him to the rules for defining a vector space.\u00a0 A short aside is warranted on this point.\u00a0 Depending on which textbook you read, there are subtle differences in what is presented.\u00a0 Some books enumerate only eight properties, some only seven, and the ones that do it best list 10. \u00a0All of them functionally amount to the same thing but standardization seems to elude the community at large, much to the confusion of students.<\/p>\n<p>I touched on all the abstract definitions and properties just to show that there was a firm structure we could build on, but I emphasized that the prototype example of a vector that one could almost always use and never be led astray was a list.\u00a0 I emphasized that what made the list useful was that it was a vector space in its own right and that almost all other vector spaces could be put into correspondence with a list.\u00a0 I also emphasized that, while the list was helpful, it is often only a representation of the vector in question, and that we shouldn&#8217;t be seduced into thinking it was the vector itself. \u00a0A velocity vector is no more a list of numbers than Bernard Riemann is the list of pixels in the 2-array of light and shadow below.<\/p>\n<p><a href=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/Bernard_Riemann.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-109 aligncenter\" src=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/Bernard_Riemann-232x300.jpg\" alt=\"Bernard_Riemann\" width=\"232\" height=\"300\" srcset=\"https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/Bernard_Riemann-232x300.jpg 232w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/Bernard_Riemann.jpg 263w\" sizes=\"auto, (max-width: 232px) 100vw, 232px\" \/><\/a><\/p>\n<p>We finished our discussion by touching on infinite-dimensional vector spaces, and I could see that what I really needed was a concrete example that he could play with.\u00a0 After about an hour of back-and-forth I finally came up with something that he seemed to grasp.\u00a0 I offer it here in the hopes that others will be able to use it as well.<\/p>\n<p>What I wanted to create was a model where four properties were met:<\/p>\n<ul>\n<li>The basic units are lists<\/li>\n<li>These lists can be added component-wise<\/li>\n<li>The lists can be infinite<\/li>\n<li>The lists can be directly translated into a picture that visualizes magnitude and direction<\/li>\n<\/ul>\n<p>A note is needed on the point that the lists can be infinite.\u00a0 By this I mean that the length of the list was limited only by our patience and aesthetics or by the physical memory of the machine.\u00a0 Much in the usual idea of infinity, I wanted a system where the student could always reach into the bag and pull out another dimension (being assured that the student would tire before the computer would).<\/p>\n<p>The model that I created is expressed in the computer algebra system wxMaxima 11.08.0 running Maxima version 5.25.0. I like Maxima for several reasons, chief amongst them being that it is very capable and it is free.<\/p>\n<p>Being based on LISP, Maxima is quite comfortable handling the first property.\u00a0 For the second and third properties, I wanted a way to add lists of different lengths, so that the student would never encounter a limitation saying that one list was as long as another.\u00a0 A different way of expressing that is to say that if there are two lists<br \/>\n\\[ M = \\left[ m_1, m_2, m_3 \\right]\\]<br \/>\n\\[ N = \\left[ n_1, n_2, n_3, n_4, n_5 \\right]\\]<br \/>\nthey are not actually different in length since we can always imagine that they list only the portions of themselves beyond which there are only zeros (i.e. $$m_3$$ and $$n_5$$ \u00a0are the last non-zero entries in their respective lists) so that they actually look like<br \/>\n\\[ M = \\left[ m_1, m_2, m_3, 0, 0, 0,&#8230;,0,&#8230; \\right]\\]<br \/>\n\\[ N = \\left[ n_1, n_2, n_3, n_4, n_5,0,&#8230;,0,&#8230; \\right]\\]<br \/>\nTo do this I wrote a small Maxima function called add_lists that pads the smallest of the two lists with zeros and then returns the sum.\u00a0 The code for it is<\/p>\n<div style=\"background-color: #d5d5dc; border: solid 1px black;\">\n<pre>add_lists(a, b)  := block([ret_lst],\r\n                      Na    : length(a),\r\n                      Nb    : length(b),\r\n                      delta : abs(Na-Nb),\r\n                      pad   : makelist(0,i,1,delta),\r\n                      if Na &gt; Nb \r\n                         then ret_lst : a + append(b,pad) \r\n                         else ret_lst : append(a,pad) + b);\r\n<\/pre>\n<\/div>\n<p>For the final property, I decided that a plot of a Fourier series in the interval $$[0,L]$$ would correspond to the visual addition of the vectors.<\/p>\n<p>The particular choice of Fourier series is the cosine series given by<br \/>\n\\[ f(x;L) = \\sum_{n=1}^{\\infty} a_n \\cos \\left( \\frac{ 2 \\pi n x}{L} \\right) \\; , \\]<br \/>\nwhere the constant offset term given by $$a_0$$ has been set equal to zero and the presence of the term L there to remind us of the interval over which the function is defined.\u00a0\u00a0 Traditional treatments in advanced mathematics and quantum texts, drive the point that the sine and cosine function are orthogonal polynomials<br \/>\n\\[ \\int_0^{2 L} dx \\cos \\left( \\frac{ 2 \\pi n x}{L} \\right) \\cos \\left( \\frac{ 2 \\pi p x}{L} \\right) = \\delta_{np} L \\]<br \/>\n\\[ \\int_0^{2 L} dx \\sin \\left( \\frac{ 2 \\pi n x}{L} \\right) \\sin \\left( \\frac{ 2 \\pi p x}{L} \\right) = \\delta_{np} L \\; \\; (n \\neq 0)\\]<br \/>\n\\[ \\int_0^{2 L} dx \\cos \\left( \\frac{ 2 \\pi n x}{L} \\right) \\sin \\left( \\frac{ 2 \\pi p x}{L} \\right) = 0 \\]<br \/>\nin a Sturm-Liouville sense and thus are basis vectors in some abstract space.\u00a0 The coefficients $$a_n$$ are then the components of the general vector (function) \u00a0in this space. \u00a0While important to the theoretical underpinnings, these relationships obscure what is really a rather simple concept that two sets of constants can be added together as a short hand for adding the two trigonometric series together and thus lists of these constants form a vector space in their own right.<\/p>\n<p>Thus the list $$A = \\left[a_1, a_2, &#8230;\\right]$$\u00a0is the representation of the vector (in component or list form) and the function fourier_series given by<\/p>\n<div style=\"background-color: #d5d5dc; border: solid 1px black;\">\n<pre>fourier_series( lst, L ) := block([expr],\r\n                                  expr : 0,\r\n                                  for i : 1 step 1 thru length(lst) do \r\n                                   ( temp_expr : lst[i]*cos(2*\n                                     expr : expr + temp_expr ),\r\n                                  expr);\r\n<\/pre>\n<\/div>\n<p>is what delivers the corresponding expression that is plotted.<\/p>\n<p>The final step is to take two lists, plot them separately to give the \u2018direction and magnitude\u2019 of each, and then to add them together plot-wise (that is to say plot the sum of the expressions) and show that the resulting vector is the same that is obtained if the two lists of coefficients are add together first and then plotted.<\/p>\n<p>For a concrete example take the lists<br \/>\n\\[A = \\left[-1,\\frac{1}{2},-\\frac{1}{3},\\frac{1}{4},-\\frac{1}{5},\\frac{1}{6},-\\frac{1}{7}\\right] \\]<br \/>\nand<br \/>\n\\[B = \\left[1,\\frac{4}{5},\\frac{3}{5},\\frac{2}{5},\\frac{1}{5}\\right] \\; .\\]<\/p>\n<p>Lists $$A$$ and $$B$$ produce a plot of $$f_A(x;L)$$ and $$f_B(x;L)$$\u00a0over the interval $$x \\in \\left[0,L\\right]$$<br \/>\n<a href=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_A_and_B.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-119 size-full\" src=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_A_and_B.jpg\" alt=\"fourier_vector_plot_A_and_B\" width=\"500\" height=\"300\" srcset=\"https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_A_and_B.jpg 500w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_A_and_B-300x180.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><br \/>\nWith corresponding expansions of fourier_series(A,L)<br \/>\n$$f_A(x;L) = -{{\\cos \\left({{7\\,\\pi\\,x}\\over{5}}\\right)}\\over{7}}+{{\\cos \\left({{6\\,\\pi\\,x}\\over{5}}\\right)}\\over{6}}-{{\\cos \\left(\\pi\\,x\\right)}\\over{5}}+{{\\cos\\left({{4\\,\\pi\\,x}\\over{5}}\\right)}\\over{4}}-{{\\cos \\left({{3\\,\\pi\\,x}\\over{5}}\\right)}\\over{3}}+{{\\cos \\left({{2\\,\\pi\\,x}\\over{5}}\\right)}\\over{2}}-\\cos \\left({{\\pi\\,x}\\over{5}}\\right)$$<\/p>\n<p>and fourier_series(B,L)<\/p>\n<p>$$f_B(x;L) = {{\\cos \\left(\\pi\\,x\\right)}\\over{5}}+{{2\\,\\cos \\left({{4\\,\\pi\\,x}\\over{5}}\\right)}\\over{5}}+{{3\\,\\cos \\left({{3\\,\\pi\\,x}\\over{5}}\\right)}\\over{5}}+{{4\\,\\cos\\left({{2\\,\\pi\\,x}\\over{5}}\\right)}\\over{5}}+\\cos \\left({{\\pi\\,x}\\over{5}}\\right)$$<\/p>\n<p>The \u2018vector sum\u2019 \u00a0\u00a0gives the expression<\/p>\n<p>$$f_A(x;L) + f_B(x;L) = -{{\\cos \\left({{7\\,\\pi\\,x}\\over{5}}\\right)}\\over{7}}+{{\\cos \\left({{6\\,\\pi\\,x}\\over{5}}\\right)}\\over{6}}+{{13\\,\\cos \\left({{4\\,\\pi\\,x}\\over{5}}\\right)}\\over{20}}+{{4\\,\\cos \\left({{3\\,\\pi\\,x}\\over{5}}\\right)}\\over{15}}+{{13\\,\\cos \\left({{2\\,\\pi\\,x}\\over{5}}\\right)}\\over{10}}$$<\/p>\n<p>and the corresponding plot<\/p>\n<p><a href=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_A_plus_B.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120 size-full\" src=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_A_plus_B.jpg\" alt=\"fourier_vector_plot_A_plus_B\" width=\"500\" height=\"300\" srcset=\"https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_A_plus_B.jpg 500w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_A_plus_B-300x180.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>The student can then confirm this in terms of adding the list representations together by executing C = add_list(A,B) which yields<\/p>\n<p>\\[ C = \\left[0,\\frac{13}{10},\\frac{4}{15},\\frac{13}{20},0,\\frac{1}{6},-\\frac{1}{7}\\right] \\; .\\]<\/p>\n<p>&nbsp;<\/p>\n<p>Evaluating $$f_C(x;L)$$ = fourier_series(C;L) which yields the identical expression<\/p>\n<p>$$f_C(x;L) = -{{\\cos \\left({{7\\,\\pi\\,x}\\over{5}}\\right)}\\over{7}}+{{\\cos \\left({{6\\,\\pi\\,x}\\over{5}}\\right)}\\over{6}}+{{13\\,\\cos \\left({{4\\,\\pi\\,x}\\over{5}}\\right)}\\over{20}}+{{4\\,\\cos \\left({{3\\,\\pi\\,x}\\over{5}}\\right)}\\over{15}}+{{13\\,\\cos \\left({{2\\,\\pi\\,x}\\over{5}}\\right)}\\over{10}}$$<\/p>\n<p>and the identical plot<\/p>\n<p><a href=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_C.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-121 size-full\" src=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_C.jpg\" alt=\"fourier_vector_plot_C\" width=\"500\" height=\"300\" srcset=\"https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_C.jpg 500w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2014\/11\/fourier_vector_plot_C-300x180.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post grew out of a discussion I had with my son who is now learning physics at the high school level.\u00a0 He was reading his text book with the&#8230; <a class=\"read-more-button\" href=\"https:\/\/underthehood.blogwyrm.com\/?p=107\">Read more &gt;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11,12,13],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-fourier","tag-maxima","tag-vectors"],"_links":{"self":[{"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":27,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":363,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions\/363"}],"wp:attachment":[{"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}