PIC 16 Python with Applications
Homework 1
Puck Rombach
Challenge 1 largerindex(l)
Write a function that takes as input a list l of numbers, and outputs a new list k, such that k[i] = 1 if
l[i] > i, k[i] = 0 if l[i] = i, and k[i] = 1 if l[i] < i.
.
Challe

Math 33B: Dierential Equations
Midterm Exam 1
Wednesday, Apr. 24, 2013 -9:00 - 9:50 AM
Instructor: Aliki M.
Name:
PLEASE PRINT
UID:
Section:
Discussion sections:
Tuesday with: S. Kim - 1A | F. Robinson - 1C | J. Rooney - 1E
Thursday with: S. Kim - 1B |

Math 33B: Dierential Equations
Midterm Exam 2
Wednesday, May 22, 2013 -9:00 - 9:50 AM
Instructor: Aliki M.
Name:
PLEASE PRINT
UID:
Section:
Discussion sections:
Tuesday with: S. Kim - 1A | F. Robinson - 1C | J. Rooney - 1E
Thursday with: S. Kim - 1B | F

Math 33B: Dierential Equations
Practice problems 1
Instructor: Aliki M.
ANSWERS
Problem 1
y 3 4y x3 + 1 = 0
16
The solution is dened within |x3 1| < .
3 3
Problem 2
x2 + 1
y=
2
The solution is dened for all values of x, i.e. within < x < .
Problem 3
Crit

Math 33B: Dierential Equations
Practice problems 2
Instructor: Aliki M.
ANSWERS
Problem 1
(ii)
(iii)
x
1
yp (x) = x ln x
4
16
x
1
y(x) = c1 x + c2 x3 + x ln x
4
16
Problem 2
y(x) = 2e2x + 6ex
Problem 3
(ii)
y(x) = c1 e2x + c2 ex xex .
(iii)
1
y(x) = c1

Math 33B: Dierential Equations
Practice problems 1: 1st order ODEs
April 2013
Instructor: Aliki M.
Review list
Midterm 1 will focus on solving rst order ODEs using the techniques covered in
Lectures 1-9:
separating variables [Lectures 1 & 2]
integratin

Math 33B: Dierential Equations
Practice problems 2: 2nd order ODEs
May 2013
Instructor: Aliki M.
Review list
Midterm 1 will focus on solving second order ODEs and the material is covered in
Lectures 10-18.
Homogeneous second order ODES:
The second orde

Math 33B: Dierential Equations
Practice problems for nal: Section A
June 2013
Instructor: Aliki M
1. Find the particular solution of
x2 y = ey ,
with y(1) = 0.
What is the interval of existence of this solution?
2. Find the general solution y(x) to the fo

Math 33B: Dierential Equations
Review 11: Reduction of order
Feb. 12, 2014
1
Instructor: aliki m.
Introduction
The reduction of order method is a general method for solving linear, homogeneous ODEs
even when the coecients of y and y are nonconstant functi

PIC 16 Python with Applications
Lecture 6
Puck Rombach
Turtle
You may have seen turtle or superlogo as a kid. Turtle is a simple programming environment, which
is a visual and intuitive way to practice algorithm structure. The basic moves of the turtle ar

PIC 16 Python with Applications
Lecture 8
Puck Rombach
Plotting 2D functions using numpy
We use numpy.ogrid to create a 2-dimensional gridas the input set for a 2D function. In numpy,
the letter j is used to indicate the imaginary unit i = 1. In numpy.ogr

PIC 16 Python with Applications
Lecture 7
Puck Rombach
Pandas, Matplotlib and Numpy
We use the modules pandas and matplotlib to import a dataset and create a nice visualization. Pandas
assumes that your data file has rows separated by newlines, and column

PIC 16 Python with Applications
Lecture 4
Puck Rombach
Groups and quantifiers in regular expressions
In python re, we cannot use a modifier on a capturing group. For example, if we would like to find
sequences of 10 words in a row, with no punctuation, th

PIC 16 Python Spring 2017
Lecturer: Puck Rombach ([email protected])
Overview
The course will cover the following topics (one per week):
1. Basics
2. Regular Expressions
3. Visualizations
4. Image Processing
5. Data Analysis
6. Symbolic Math
7.

PIC 16 Python with Applications
Homework 2
Puck Rombach
Challenge 1 mytype(v)
Write a function that performs the same action as type(), and can recognize integers, floats, strings,
and lists. Do this by first using str(v), and then reading the string. Ass

PIC 16 Python with Applications
Lecture 5
Puck Rombach
Captured Groups in Regular Expressions
Recall that we use parentheses (.) to capture groups in a regular expression. The groups are numbered 1,2,3,. by the appearance of their opening parenthesis. We

PIC 16 Python with Applications
Lecture 3
Puck Rombach
Regular Expressions
Regular expressions are a language to describe patterns in strings. They are extremely useful when
working with data sets. To start, we need the module re, and two functions from i

Math 33B: Dierential Equations
Homework 6: Second order ODEs & Applications
Due on: Fri., Nov 21, 2014 -
9:00 AM
Instructor: aliki m.
Please include your name, UID and discussion section on the submitted homework.
Problem 1
In the following problems, sol

Mathematics 33B: Homework 5
Due 5/14.
NOTICE: Only the problems in bold face are to be turned in. The rest of
the problems are suggested problems that you should try hard to solve and
write up. You will not turn in these problems though. My suggestion is

Mathematics 33B: Homework 3
Due 1/26.
NOTICE: Only the problems in bold face are to be turned in. The rest of
the problems are suggested problems that you should try hard to solve and
write up. You will not turn in these problems though. My suggestion is

Mathematics 33B: Homework 2
Due 4/16.
NOTICE: Only the problems in bold face are to be turned in. The rest of
the problems are suggested problems that you should try hard to solve and
write up. You will not turn in these problems though. My suggestion is

Mathematics 33B: Homework 6
Due 5/28.
NOTICE: Only the problems in bold face are to be turned in. The rest of
the problems are suggested problems that you should try hard to solve and
write up. You will not turn in these problems though. My suggestion is

Mathematics 33B: Homework 6
Due 5/28.
NOTICE: Only the problems in bold face are to be turned in. The rest of
the problems are suggested problems that you should try hard to solve and
write up. You will not turn in these problems though. My suggestion is

Mathematics 33B - Practice Midterm
NAME (please print legibly):
Your University ID Number:
Your Discussion Section and TA:
Signature:
Calculators, notes and books may not be used in this examination.
You may not receive full credit for a correct answer

Mathematics 33B - Practice Final
Instructor : D. E. Weisbart
NAME (please print legibly):
Your University ID Number:
Your Discussion Section and TA:
Signature:
QUESTION VALUE SCORE
1
20
2
20
3
20
4
20
5
20
6
20
7
20
8
20
9
20
TOTAL
100
1
1. (20 points) An

PIC 16 Python with Applications
Quiz 1
Puck Rombach
Quiz 1
Write a function powerlists(L, k) that takes as input a list of numbers L = [a, b, c, . . .] and a natural
number k, and outputs a list of k lists, one with elements a, b, c, . . ., one with eleme

PIC 16 Python with Applications
Quiz 2
Puck Rombach
Quiz 2
Write a regular expression that matches to valid times on a digital clock, which may appear somewhere in a string. So, 22:41 and 2:03 are valid times, but 27:01 or 2:77 are not. You only need to
w

PIC 16 Python with Applications
Quiz 3
Puck Rombach
Quiz 3
Write a recursive function in Turtle that draws the following fractal: start with a square with sides
of length L. Inside this square is a square with sides of length (3/4)L, which shares the bott