This repository contains the course materials from Math 157: Intro to Mathematical Software.
Creative Commons BY-SA 4.0 license.
License: OTHER
Math 157: Intro to Mathematical Software
UC San Diego, winter 2018
March 5, 2018: Julia (part 2 of 3)
Guest lecture by Alyson Deines (Center for Communications Research)
Administrivia:
CAPE evaluations are available! They close Monday, March 19 at 8am. Since this course is highly experimental, your feedback will be very helpful for shaping future offerings.
No sections on Tuesday, March 6. However, during this time, you are welcome to use APM 6402 as a study room; we will also try to monitor the chat room.
Thomas's office hours (usually Tuesday 11am-12pm) are moved to Friday 11:30am-12:50pm.
Peter's office hours (usually Wednesday 3-5pm) are moved to Wednesday 5-7pm.
There will be an extra virtual office hour Thursday 6-7pm.
Advance notice for week 10:
No lectures on Monday, March 12 or Wednesday, March 14. You may wish to use this time to meet your final project group.
There will be a lecture on Friday, March 16, on the topic of "Where to go from here?" This lecture will not be counted for course attendance; that is, the last lecture for which attendance counts is Friday, March 9.
My office hours on Thursday, March 15 are cancelled. All other sections and office hours meet as scheduled.
Final project news
Both parts will be collected Sunday, March 18 at 8pm.
The groups for part 2 have been assigned. See the file
final_project_groups.md
in the shared project; then contact your group members as soon as possible. (I have created workspaces and chat rooms which may help with this; these are described in the same file.)For part 1, problem 4b, instead of the exhaustive search, do random sampling with samples. Ditto for 4c.
Linear Algebra in Julia
Vectors and Matrices
Julia views vectors as flat arrays and matrices as two-dimentional arrays.
To get a "row" vector:
To get a "column" vector:
Vectorized Functions
A vectorized function is a function that simply applies to every element of an array to yield . The syntax in Julia for this is .
Matrices:
You don't always need * for multiplication
Here is where things start looking even more like numpy and a lot less like Sage.
Solve a system. Note we can force the matrix and vector to have entries of a specific type.
vs.
Several ways to add rows and columns:
A few numpy-ish functions on matrices