CPSC 303 Page, Spring 2020

This page concerns CPSC 303 Section 201.

This page has the most up-to-date information on the course(s) and supersedes any other document.

Materials below may have errors! Errors will be corrected either here or in class. If you are not attending my classes: use these materials at your own risk!

News April 14: Information relevant to taking and studying for the final exam has been gathered in a guide for the final exam.

I've added more practice problems for the final exam with some brief solutions [both last modified April 15, 3:18pm, typos on 1(l)-(n)]. I am focusing on the material not covered on the midterm, namely splines (Section 11.3 in [A&G]) and the material after March 13. Note that the practice problems begin with a review about important formulas relating to the material after March 13.
You should note that the conventions and notation regarding splines, the heat equation, and other topics past Chapter 10 (interpolation) are very particular to this course and [A&G]. In the literature there are many other conventions and notation.

Be Safe and Well (and hang in there as you adjust to the "new normal")

April 13: I have written some practice problems for the final (see April 14). I have changed some of the notation in the article on Energy in Cubic Splines to use x_i instead of t_i, to be consistent with Section 11.3 of [A&G] (in Sections 11.1 and 11.2, [A&G] uses t_i and sometimes x_i).

We will enforce of academic integrity via the theory of error correcting codes (each student's exam will be unique and of large Hamming distance to each other exam); make sure that the exam you have received and are doing has your ugrad email address and student ID on it.

I have been assuming that you are learning at roughly 50% of the normal rate after March 13. Hence the final exam will consist of roughly 80% material taught on or before March 13. Note that Homework 7 and 8 actually contain a lot of overlap with material before March 13, due to the "rod matrices" that are fundamental both to splines and to the discrete heat equation.

Be Safe and Well (and hang in there as you adjust to the "new normal")

April 12: Solutions to Homework 7 and Homework 8 are posted below.

Be Safe and Well (and hang in there as you adjust to the "new normal")

April 10: The Final Exam will be open book in the sense that you can use all CPSC 303 materials of this year (the textbook [A&G] and the handouts and homework on the website), and any notes you have taken. Of course, students cannot post, communicate, or solicit answers from outside sources. You are free to use other sources (e.g., a different textbook, Wikipedia, online notes from another course, notes of another student, etc.) with the following warning: other sources may have errors, and/or their notation and conventions may be so different from ours that you will get the wrong answers on the CPSC 303 Final Exam by following these other sources. On the exam you are responsible for the concepts, definitions, theorems, formulas, etc., as we have developed them in this term's version of CPSC 303.
[As an example, other versions of this course may have studied Chapter 2 of [A&G] without understanding subnormal numbers and their role in how MATLAB reports numbers in double precision; you are responsible for understanding subnormal numbers as we discussed them this term.]

I am (hopefully...) sending to all students a copy of the March 11, 2020 midterm taken. Please go to canvas.ubc.ca and fill out the assignment for CPSC 303 201 entitled: "Pre-Exam Survey 1". We'll iron out any bugs in the system and address any concerns you have over the long weekend.

Homework 7 and 8 solutions will be posted on Sunday, April 12.

I encourage to take some time each day to connect with your family and friends, do a bit of "self-care", relax a bit, and, if possible, go out for a walk where you can maintain a safe social distance. (I am trying to do this, and more or less succeeding.)

Be Safe and Well (and hang in there as you adjust to the "new normal")

April 9: Midterm scores have been released on gradescope; you may submit regrade requests; the median score was a 23 out of 30; here are solutions.

On March 23, the Dean's office granted UBC Science students the option changing any letter grade on any course they choose to either a Credit/D/F or W, provided that a request for academic concession is made by May 6, 2020 (finals end on April 29, with grades due on May 4, I believe). It is worth considering the spirit of this unusually flexible concession policy, beyond the mere technicalities.
The COVID-19 has negatively impacted everyone in the UBC community. It is becomig clear that the COVID-19 pandemic will not allow learning to continue as before Spring 2020 for at least some 6 to 18 months (sure, I hope it's less). Many of the UBC community have not been able to carry out their work as usual; we are concerned for our health and that of our family and friends; we are facing great uncertainty and a lack of control that we have not expected; some of us have living situations and other problems that are more challenging than we anticipated, likely exacerbated by the pandemic. There is neither fairness nor equality in the fallout from COVID-19; the Dean's office is trying to offer the small amount of equity it can reasonably dispense regarding grades and transcripts.
You may also like to hear or read Santa Ono's recent update to the UBC community--in casual attire, with a fireplace in the background.

Be Safe and Well (and hang in there as you adjust to the "new normal")

April 8: Here are some details regarding the final exam that have recently emerged; by the end of the week these details should become clearer.
The final exam will consist entirely of questions that are either (1) true/false, (2) multiple choice, (3) short answer. You will type your answers into canvas.ubc.ca.
Most likely you will have the exam delivered by one of (1) email to your "a1b2c" ugrad.cs.ubc.ca account, (2) Canvas, (3) something similar. There will be a "Plan B" (i.e., alternate plan to the primary method of exam delivery).
This week I will survey you, via Canvas, for you to tell me the particulars of your situation, time zone, etc.
We will test the exam delivery system and your ability to take online tests using Canvas (in case you have never done so) by the end of the week; we cannot use gradescope.com for the final exam.
I am in the process of putting content into webpages for a guide for the final exam and the revision to the grading scheme The reweighting gives you the option of having the final exam count for only 5%; I fully support the idea of reducing stress during this usually difficult exam period.

I imagine that there will be a larger number of deferred exams granted, given the amount of unexpected stress from the COVID-19 pandemic fallout. Of course, if your technology fails during the final you will be granted a later final exam.

Be Safe and Well (and hang in there with the "new normal")

April 3: Homework 8 was posted recently. It is a large document on differential equations, lacking material on ODE's, which will supplemented and taught the next time I teach CPSC 303. For this year, please read Sections 1-6, omitting Subsections 2.3-2.7 (Section 2 does not contain any exercises). You should be able to do the exercises appearing in this material. Alternatively, you can wait to see the sample final exam problems based on this material, e.g., the kind of T/F questions, multiple choice, etc. (and some likely easier than the more difficult exercises in Sections 1-6).

Some brief iPad-note lessons with audio may follow on material past March 13 and sample exam problems.

By later next week I should have a better idea of how the final exam will be delivered online. I will poll each student, likely through Canvas, regarding the particulars of your situation, your needs (e.g., as would normally be addressed through Access and Diversity), etc.

I will endeavour to fairly meet each of your needs for the final exam during this difficult period in time.

Homework 8 contains a last section with some MATLAB code to simulate a 2-body problem solution, and I have set it up with a few trial runs. I find this "fun" to look at, and I sometimes change the numbers a bit to get different orbits of two stars/planets. If you have some extra time (and this is not for course credit), you could modify this code to make it a 3-body or 4-body problem solver; under certain initial conditions, the orbits can be rather unpredictable (unlike with 2 bodies), and is one of the ODE's that contributed to the birth of so-called "chaos theory."

Be Safe and Well (and hang in there with the "new normal")

March 27: Homework 7 is now posted (due in two weeks from today). The last homework, Homework 8, will be assigned, and solutions will be given, but it will not be graded.
The exam(s) on Thursday, April 16, will cover new material introduced online up to two weeks before the exam. The only new material from today will be posted as part of Homework 8 (which will contain some new material and/or refer to parts of [A&G]); it will cover a bit about differential equations and their solutions. All material posted online after Thursday, April 2 will be review for the final exam.

Be Safe and Well (and hang in there with the "new normal")

March 26: I've been busier than anticipated and need an extra day to produce some new material. Homework 7 will appear by tomorrow, Friday, March 27, and due two weeks later. See news of March 23 below.

Be Safe and Well

March 23: Homework 7 will appear by Thursday, March 26, Friday, March 27, 11:59pm, Pacific Time. It will be due on Thursday, April 9, Friday, April 10, 11:59pm Pacific Time, two weeks from March 26 27; see remarks on Homework 7 below. Sample exam problems based on Homework 7, some with solutions, will then follow. Homework 8 will be the last homework, and will not be collected.

Out of ethical considerations, I will not conduct any interactive classes for CPSC 303 for the rest of the term. Given the class size, I understand that likely a number of you in CPSC 303 cannot attend the regular 2-3pm MWF classes due to the particular affect of COVID-19 on your lives; I think that the added stress and disadvantage of holding our usual 2-3pm MWF classes to those who cannot participate outweights the small benefit to other students of continuing on as we did before the onset of COVID-19. Please continue to post your questions to www.piazza.com; we will do the best we can.
I may post some "lectures" of iPad sketching and audio, in addition to the usual posting of handouts, homework, solutions, and sample exam problems with some solutions.
Of course, if issues arising from COVID-19 have had a significant impact on your personal life and/or bandwidth, you will be--as usual--granted an academic concession for a later final exam.

Have you observed how the fallout from COVID-19 has affected your lives? I certainly have seen this in mine. There is nothing wrong if in recent days you find yourself:
  • making a new playlist of inspiring and peaceful songs;
  • playing and/or singing a song of resiliance 20 or more times in a row (e.g., I Won't Back Down by Tom Petty, I Stand Strong by Burning Spear, Iron Lion Zion by Bob Marley & The Wailers, etc.), perhaps a bit more loudly than usual;
  • being especially kind to yourself, family, and friends;
  • understanding new meaning in some familiar poems or songs;
  • walking through a park and noticing the changes;
  • taking a (currently free of charge) bus in Vancouver that that allows for a safe social distance (a lot of buses are pretty empty these days);
  • buying a gift for yourself (within reason) or a special food you like but don't normally eat (within reason) to treat yourself;
  • beginning a journal (you and your friends and relatives may enjoy sharing these one day);
  • chatting with your neighbours (at a safe social distance) or your friends and family (some via the internet) more often;
  • taking the time to bake bread or try out a few new recipes for which you never felt you had the time;
  • measuring a slight rise in your regular blood pressure measurements.
  • restringing an old acoustic guitar and using a pencil (or graphite) in the ridges of the nut to have the guitar stay longer in tune (you might be playing it a lot these days).
  • Can you add to this list? I think you can probably add a few...

    Be Safe and Well

    March 19, 11:56pm, Pacific Time: The final exam will be a 2.5 hour open book exam. I am expecting to write up to 4 different versions of the final in order to accomodate people in different time zones. As a practical matter of grading, there will likely be more multiple choice and/or T/F questions on this term's 303 exam (this does not mean the exam will be any easier).
    The precise mechanism for delivering the final has yet to be set. It will likely have some enforcing mechanism, but otherwise rely on your honour.
    Given other priorities for me at home and work, please be patient with the midterm grading and my generation of materials for the rest of the course. For now, please keep reading the handout on Energy in Splines; this year we'll stop at Section 4.4.
    From now on, I will simultaneously release units consisting of (1) homework and (2) their corresponding sample exam problems. I am restructuring the rest of the course to cover two last units: (1) an intro to the Heat Equation and its numerical solution, and (2) an intro to ODE's, some examples, and brief remarks on their numerical solutions.

    I will modify your homework grade to be (still worth 10%) to be

    max( hw_before_event, hw , mid , final )

    where hw = homework, mid = midterm, final = final, and

    hw_before_event = top 2 scores out of homework 1-5

    This adjustment may cause the course average to be slightly higher than in previous terms, but that is neither my problem nor yours.

    To keep in contact with loved ones far away, you might try Winston-style Skyping: a friend of mine was a PhD student at UBC, having to leave his spouse and two kids home in Africa. He would coordinate 2 hours every Sunday with his family (despite the time difference), during which time he would leave Skype on. For part of the time he would directly talk to his family. Other times he might do a few dishes, etc., but just leave the Skype on. This way he wasn't glued to his screen for the entire 2 hours, and could still go about his chores and other normal life activities, always hearing his family around. I have never tried this, but I will soon. If this works, thank Winston (like me).

    Be Safe and Well

    FWIW: Survey results: Turnout = 9.21...% Best fits:
    infty - norm = 4,
    2 - norm = 59/14 = 4.214...,
    1 - norm = 4

    March 13: Classes transition to online, effective Monday, March 16.
    There will be a fair and reasonable way for students to finish this course; details will be announced. I understand that in the last 1/3 of this term, many students will be less able to concentrate on studying, and I will make fair accomodations for those who need it.
    Don't forget those stress relieving activities like the gym (while open), vigorous exercise, yoga, meditation and meditative practice, playing and listening to music, long walks, watching/reading good sci-fi and other fiction (avoid binge watching), good non-fiction (e.g., below), etc.
    Now would be a great time to be in closer contact with your parents--if you are lucky enough to have them around and are on good terms with them--and, of course, other friends and family; they want to know how you are doing.
    Class today corresponds to some part of Sections 4.2-4.4 of the new handout: CPSC 303: Energy in Cubic Splines, Power Series as Algorithms, and the Initial Value Problem (last modified April 13).

    March 5: More midterm information and practice sets/solutions are being added below under Midterm and Final.

    Diversity news: February is Black History Month in Canada. For example, with your UBC CWL you can (free of charge) watch I Am Not Your Negro (James Baldwin, posthumously) and read some non-fiction of numerous authors, including Baldwin and Cornel West, in Black Thought and Culture,

    Feb 2: Office hours for most of February and HW1 solutions are posted below. Make sure that homework done as a group is submitted as a group to gradescope.com (instructions).
    Overview This is an introductory course in numerical approximation and discretization. The material corresponds to parts of Chapters 10-16 of the course textbook by Ascher and Greif, with an emphasis on polynomial interpolation and the numerical solution of differential equations (see below for details).
    Policy This policy webpage describes the course policy, including the prerequisites and grading scheme.
    References The required course textbook is A First Course in Numerical Methods by Uri Ascher and Chen Greif, available online for free to anyone wth a UBC CWL. You may need to follow this link to get to UBC's online version; you can also purchase a hardcopy from the UBC Booksore.
    Our course will cover some of Chapters 10-16 of the textbook; we remark that the textbook has some very difficult and specialized material that we will omit (see the Syllabus below).
    Aside from the textbook, we will use some material--notes and articles--which I will supply:

  • The first 4 classes (Jan 6-8) will cover most of CPSC 303: Recurrence Relations and Finite Precision; this version is a draft which may be modified.
  • CPSC 303: What the Condition Number Does and Does Not Tell Us; this version is a draft which may be modified.
  • CPSC 303: Normal and Subnormal Numbers in Double Precision; this version is a draft which may be modified.
  • CPSC 303: Remarks on Divided Differences (last modified Feb 23, 11:26pm); this version is a draft which may be modified.
  • CPSC 303: Energy in Cubic Splines, Power Series as Algorithms, and the Initial Value Problem (last modified April 13); this version is a draft which may be modified.

  • Since the prerequisites for this course require only two terms of calculus, we will spend a class or two on examples of differential equations and what they mean (when we reach Chapter 16).
    Software MATLAB will be used in class to perform some numerical computations, and will be required for numerical computations on the homework. MATLAB is available free of charge to all active UBC students.
    (MATLAB syntax will not be examined on the midterm or the final exam; however, you will be responsible for knowing homework and class material illustrated by our MATLAB computations.)
    There are a number of good intros to MATLAB, including MATLAB's Primer (in PDF) .
    Additional Resources There are many useful resources on Jessica Bosch's CPSC303 page from 2017-18 and Ian Mitchell's CPSC303 page from 2012-13, including some MATLAB resources.
    We remark that previous versions of CPSC 303 will differ in content and emphasis from this year's version. For example, this year's course will probably spend more time on ODE's and PDE's (both giving real-world examples and discussing numerical methods). https://matlabacademy.mathworks.com
    Syllabus Here is a tentative list of what we will cover; topics may be added or skipped. [A&G] refers to the textbook by Ascher and Greif.
  • CPSC 303: Recurrence Relations and Finite Precision; this version is a draft which may be modified. [Roughly 4 classes]
  • Chapter 10 of [A&G] (polynomial interpolation) All sections. [Roughly 3 weeks]
  • Sections 11.1-11.3 of [A&G] (splines and related piecewise interpolation), minimizing (of square of 2nd derivative) property of splines, minimizing (square of piecewise 1st derivative) property of linear interpolation (between two data points). [Roughly 1 week]
  • Section 14.1 of [A&G]. [Roughly 1 class]
  • Sections 15.1-15.2 of [A&G]. [Roughly 2 classes]
  • Section 16.1 of [A&G], plus more examples of initial value ODE problems (integration, simple ODE's, logistical growth, n-body problem, gradient search and minimizing dynamics). [Roughly 1 week]
  • Basic ODE solvers and Runga-Kutta methods in Sections 16.2-16.3 [A&G], and their applications to the above ODE's. [Roughly 2 classes]
  • Heat Equation in 1 and 2 space dimensions (Example 16.17 of [A&G]), limitations and instability in solving the heat equation. Similar remarks for the wave equation. [Roughly 1 week]
  • (Time permitting:) Part of 16.2 of [A&G] regarding problems in ODE solving (stiffness, stability, and implicit methods).
  • (Time permitting:) Part of 13.3 of [A&G] (fast Fourier transform) plus motivation from multiplying polynomials.
  • Midterm and Final The midterm exam will cover class up to the end of Chapter 10 on Feb 26, including Homework 1-6. The midterm will be largely based on the homework, including some subtle points in the solutions. Here are some practice midterm problem sets; brief solutions will be given to some of these questions.
    Set 1 (typo fixed March 3); brief solutions. Set 2; brief solutions to some (1 typo fixed March 10). Set 3; brief solutions to some.
    Note that the above practice questions are meant to be representative rather than exhaustive.

    The midterm will be held during class hours on Wednesday, March 11, 2020, in West Mall Swing Space (SWNG), Room 222 (2175 West Mall). You may bring one two-sided 8" x 11.5" sheet of notes, written by hand or computer. You will be seated either alphabetically by last name or by order of your student ID. Please remain outside the exam room until we invite everyone in.

    Our final exam has been scheduled (at least preliminarily) for Thursday, Apr 16, 2020, 7:00 pm.
    Readings and Boards Scans Board scans (and corresponding textbook sections and/or articles) will go here.
    Homework Homework will be assigned roughly every week. At times we may grade only a portion of the homework (this portion will not be announced in advance). Late homework will not be accepted; however, your three lowest scores will be dropped in the overall homework computation.
    You can work together on the homework in a group of 1, 2, or 3 people and submit it as a group submission (instructions) to gradescope.com; please do not submit group assignments individually. At the top of your homework you must acknowledge (1) your group members, and (2) any sources you have used aside from class lectures and notes, the textbook, and handounts on this webpage.

    Homework 1 is due on gradescope.com at 11:59pm Thursday, January 23. Solutions.
    Homework 2 is due on gradescope.com at 11:59pm Thursday, January 30. Solutions, which includes a discussion of subnormal numbers in double precision.
    Homework 3 is due on gradescope.com at 11:59pm Thursday, February 6. Solutions.
    Homework 4 is due on gradescope.com at 11:59pm Tuesday, February 18. Solutions.
    Homework 5 is due on gradescope.com at 11:59pm Thursday, February 27. (It refers to Remarks on Divided Differences, last modified Feb 23, 11:26pm), Solutions. This solution indicates a lack of double precision compliance in some current versions of MATLAB, or an incomplete double precision standard(!).
    Homework 6 should be done at 11:59pm Thursday, March 5; it will not be handed in or graded. Solutions.
    Homework 7 be assigned NO EARLIER than Thursday, March 19, and therefore due NO EARLIER than Thursday, March 26.
    Homework 7 [last revised March 30, 11:24pm] is due on April 9 April 10 at 11:59pm Thursday. Solutions.
    Homework 8 [last revised April 12] will not be collected; this year we will cover Sections 1-6, omitting Subsections 2.3-2.7. You should be able to do all the exercises there. Solutions.
    Piazza and Office Hours There will be an online discussion of this course on www.piazza.com; use this link to sign up. Please post all questions related to the course material to our piazza site.

    Office hours for most of March; any last minute changes will be announced on www.piazza.com:

    Ramya (TA): 5-6pm on Monday in Demco Table 6.
    Joel (Instructor): 4-5pm on Tuesday in ICCS X561.
    Jonathan (TA): 4-5pm on Wednesday at Demco Table 2.
    Loren (TA): 4-5pm on Thursday, Demco Table 4.

    Special office hours before the Midterm:
    Joel (Instructor): 4-6pm on Tuesday, March 10, in ICCS 104.
    Diversity and Equity UBC is trying in earnest to encourage diversity and alleviate biases and inequities to which some members of its community are subjected; this includes, for example, UBC's Indian Residential School History and Dialogue Center, and well as the Computer Science Department's various programs described on its Diversity in CS webpage. I try to act reasonably free of bias; for example, I do not view sexual orientation or gender as set in stone from birth or as classified by some fixed, finite set of choices; I try to use language accordingly. I will undoubtedly goof upon occasion, and I welcome feedback on these and related matters.
    Calendar Jan. 6: class begins. Feb 17-21: Family Day and midterm break. March 11: midterm exam, during class hours. April 8: class ends. April 14-29: final exams. Our final exam has been scheduled (at least preliminarily) for Thursday, Apr 16, 2020, 7:00 pm.

    UBC CS Home| Joel Friedman Home| Course Materials