Margot Gerritsen (Stanford Univ) on the beauty of Linear Algebra

1,163 views

Published on

http://www.scaruffi.com/leonardo/sep2013.html

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,163
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Say we have 4 equations and 4 unknowns, w, x, y, z. Not every equation involves every unknown, and this gives the set ofequations an interesting structure. A mathematician would see it andmight call it beautiful -- but can you see it?
  • The coefficients of each equation can be placed in a 4-by-4 matrix,and the 4 equations can be written as the single matrix equationAx=b.Consider the matrix structure -- just the position of the nonzeros.
  • Say we have 4 equations and 4 unknowns, w, x, y, z. Not every equation involves every unknown, and this gives the set ofequations an interesting structure. A mathematician would see it andmight call it beautiful -- but can you see it?
  • Say we have 4 equations and 4 unknowns, w, x, y, z. Not every equation involves every unknown, and this gives the set ofequations an interesting structure. A mathematician would see it andmight call it beautiful -- but can you see it?
  • The coefficients of each equation can be placed in a 4-by-4 matrix,and the 4 equations can be written as the single matrix equationAx=b.Consider the matrix structure -- just the position of the nonzeros.
  • The nonzeros are now replaced by dots, and the diagonal is numbered1 to 4 for reference.A graph (on the top) can illustrate how the 4 equations and unknowns are related.1 and 3 are related, but 1 and 2 are not. So, draw a circle (a node) foreach equation, and draw an edge between related nodes.The result is the graph at the top of the slide, with nodes 1 to 4 andthe edges between them.But is it beautiful? Is this the right way to draw the graph?
  • The nonzeros are now replaced by dots, and the diagonal is numbered1 to 4 for reference.A graph (on the top) can illustrate how the 4 equations and unknowns are related.1 and 3 are related, but 1 and 2 are not. So, draw a circle (a node) foreach equation, and draw an edge between related nodes.The result is the graph at the top of the slide, with nodes 1 to 4 andthe edges between them.But is it beautiful? Is this the right way to draw the graph?
  • The nonzeros are now replaced by dots, and the diagonal is numbered1 to 4 for reference.A graph (on the top) can illustrate how the 4 equations and unknowns are related.1 and 3 are related, but 1 and 2 are not. So, draw a circle (a node) foreach equation, and draw an edge between related nodes.The result is the graph at the top of the slide, with nodes 1 to 4 andthe edges between them.But is it beautiful? Is this the right way to draw the graph?
  • Say we have 4 equations and 4 unknowns, w, x, y, z. Not every equation involves every unknown, and this gives the set ofequations an interesting structure. A mathematician would see it andmight call it beautiful -- but can you see it?
  • The coefficients of each equation can be placed in a 4-by-4 matrix,and the 4 equations can be written as the single matrix equationAx=b.Consider the matrix structure -- just the position of the nonzeros.
  • The nonzeros are now replaced by dots, and the diagonal is numbered1 to 4 for reference.A graph (on the top) can illustrate how the 4 equations and unknowns are related.1 and 3 are related, but 1 and 2 are not. So, draw a circle (a node) foreach equation, and draw an edge between related nodes.The result is the graph at the top of the slide, with nodes 1 to 4 andthe edges between them.But is it beautiful? Is this the right way to draw the graph?
  • All these are pictures of the same graph. They differ only by where thenodes are drawn. So where is node 1? Where do we draw 2? Is the number3 here, or there, anywhere, or nowhere?For a 4-node graph, just about any node positions will do. We can stillsee the relationships between the 4 nodes in any of the 3 graphs.The graph on the bottom right is best, in one sense. Nodes that arerelated to each other are close to each other, and the graph is symmetric.Nodes 2 and 4 look just the same (only flipped). This is a betterdepiction of the structure, as compared with the other two graphs whichtreat nodes 2 and 4 differently.
  • But what if the matrix is bigger?Can we just drop them randomly on the page and hope to get a good pictureof the structure of the graph? Ouch. This is not beautiful. Perhaps inan abstract sense, but this picture does not reveal the structure of thisproblem. It's hidden in the random jumbling of the node positions.
  • To compute aesthetically pleasing positions for the nodes, we use aphysics-based computational rule:Give each node an electrical charge. Make each edge a spring. Drop it onthe floor and let it wobble until it reaches a minimum energy state.
  • The graph wobbles into a low-energy state.
  • And it reveals the elegant structure of the graph that was previouslyhidden when the nodes were jumbled randomly on the page.
  • Here is one. The equations are based on probabilities of different outcomesof future economic events: What if interest rates go up? Or down? Inthis graph, a stock or bond in each possible future outcome is a node. So where is a stock? Or bond? They have no natural position on a 2-dimensional piece of paper.The different branches of this graph reflect different possible outcomes offuture economic events. It's a matrix with over 37,000 equations and37,000 unknowns -- fairly small as matrices go.So a physics-based rule is essential if we have a graph like this one that we want to visualize.But it's also beautiful.
  • The goal is to compute the best solution to an optimization problem.
  • This matrix comes from the frequency-domain simulation of a complexsemiconductor circuit. The green lines underneath the fuzz are thecircuit, and the fuzz coming off that describes what happens to the circuit at different frequencies.
  • This graph is larger, with about 660,000 nodes.
  • Here is another linear programming problem.
  • And a close-up.
  • This elegant mesh represents the fluid flow in a shallow bay of water.It could be used to simulate where pollutants would flow.
  • In the closeup, you can see the underlying hexagonal mesh. The shallow bayis divided into small triangular wedges, and the relationship betweenadjacent wedges gives a hexagonal mesh. The mesh is regular because the problem being modeled has a natural 2D or 3D structure.
  • This graph is from a student of mine who now works at Amazon.com.It's a social network, where each node is either a person or a webpage, and an edge is drawn between a person and each web page they like. Not surprisingly, the graph is very irregular.
  • Say we have 4 equations and 4 unknowns, w, x, y, z. Not every equation involves every unknown, and this gives the set ofequations an interesting structure. A mathematician would see it andmight call it beautiful -- but can you see it?
  • Margot Gerritsen (Stanford Univ) on the beauty of Linear Algebra

    1. 1. Visualizing matrices with special thanks to Tim Davis and his beautiful matrix collection, see http://www.cise.ufl.edu/research/sparse/matrices/ Margot Gerritsen ICME, Stanford margot.gerritsen@stanford.edu
    2. 2. Matrices are everywhere
    3. 3. Visualizing using spy plots
    4. 4. A small system of equations w + y = 1 x + y + z = 1 w + x + y + z = 1 x + y + z = 1
    5. 5. Written as a matrix-vector equation 1 1 w 1 1 1 1 x 1 1 1 1 1 y 1 1 1 1 z 1 =
    6. 6. 4 1 1 Every nonzero becomes a dot This is a “spy plot”
    7. 7. Spy plots of two subdomains of the Stanford internet
    8. 8. Spy plot of a matrix occuring in oil reservoir modeling
    9. 9. Spy plots where size of element is reflected in color
    10. 10. Visualizing using graphs
    11. 11. Back to our matrix-vector equation 1 1 w 1 1 1 1 x 1 1 1 1 1 y 1 1 1 1 z =
    12. 12. We can draw it in different ways Which is most appealing?
    13. 13. But what if the matrix is bigger?
    14. 14. Alaric Hall, Uni of Leeds ÁlaFlekkssaga Bæringssaga Blómstrvallasaga DámustasagaokJóns DínussagaDrambláta Drauma-Jónssaga Flóressagakonungsoksonahans Gibbonssaga Hectorssaga HermannssagaokJarlmanns HringssagaokTryggva Jónssagaleikara Kirialaxsaga Klárisagakeisarasonar Konráðssagakeisarasonar Magnússagajarls Mírmannssaga Nitidasaga Rémundarsagakeisarasonar SálussagaokNikanors Samsonssagafagra Sigrgarðssagafrœkna SigrgarðssagaokValbrands Sigurðarsagafóts Sigurðarsagaturnara Sigurðarsagaþögla Tiódelssaga TristramssagaokÍsoddar Valdimarssaga ViktorssagaokBlávus Vilhjálmssagasjóðs Vilmundarsagaviðutan ÞjalarJónssaga Alexanderssaga AmícussagaokAmílíus Bevissaga Bretasögur ElissagaokRósamundu Erexsaga FlóressagaokBlankifúr Flóventssaga Ívenssaga Karlamagnússaga Möttulssaga Parcevalssaga Partalópasaga Strengleikar TristramssagaokÍsöndar Trójumannasaga Valvensþáttr
    15. 15. Here’s an idea: Give each node an electrical charge Make each edge a spring Drop the whole system on the floor and let it “wobble” until it finds its optimal (minimum energy) state
    16. 16. Financial portfolio optimization
    17. 17. Hessian matrix from a quadratic programming problem
    18. 18. Frequency-domain circuit simulation
    19. 19. Linear programming problem
    20. 20. Computational fluid dynamics: shallow-water equations
    21. 21. Linear programming problem
    22. 22. Social network: people and the web pages they like
    23. 23. LCSH Galaxy
    24. 24. Visualizing matrices with special thanks to Tim Davis and his beautiful matrix collection, see http://www.cise.ufl.edu/research/sparse/matrices/ Margot Gerritsen ICME, Stanford margot.gerritsen@stanford.edu

    ×