MATH 31B, LECTURE 4
PRACTICE MIDTERM 1
Name:
Signature:
UID:
TA: (circle one)
Charles Marshak
Discussion meets: (circle one)
Theodore Gast
Tuesday
Andrew Ruf
Thursday
Instructions: The exam is closedbook, closednotes. Calculators are not permitted. Answ
Math 3B Lecture 1 Winter 2015
NOT accepted .
due Friday January 23 at 8 am . Late homework is
HW # 2
Name _
Section
A
B
C
D
(circle one )
UCLA ID # _
4.3 # 16,17,28,35,42
1.7 # 13,19,21,24,31,32
4.5 # 14,9,10,13,14,15,17,21,22
Turn in all of these proble
Math 3B Lecture 1 Winter 2015
NOT accepted .
due Friday Feb 6 at 8 am . Late homework is
HW # 3
Name _
Section
A
B
C
D
(circle one )
UCLA ID # _
4.3
# 24,26,38,44
4.5
# 35,41
5.1 #9,17,22,26,29
5.2 # 2,8,14,19,20,22,24,30
Chapter 4 review # 2,3,7,15,20
Tu
Math 3B Lecture 1 Winter 2015
due Wednesday February 17 at 8 am .
Late homework is NOT accepted .
HW # 4
Name _
Section
A
B
C
D
(circle one )
UCLA ID # _
Print this page and staple it to your homework papers .
Practice
5.4 # 1,5,11,15,17,27
5.5 # 1,3,7,11
Math 3B Lecture 1 Winter 2015
due Friday Feb 27
Late homework is NOT accepted .
at 8 am .
HW # 6
Name _
Section
A
B
C
D
(circle one )
UCLA ID # _
Print this page and staple it to your homework papers .
6.1
#1,3,7,10,14,16,1922,39
6.2 # 1,5,8,12,17,21,24
Math 3B Lecture 1 Winter 2015
due Monday Feb 23
Late homework is NOT accepted .
at 8 am .
HW # 5
Name _
Section
A
B
C
D
(circle one )
UCLA ID # _
Print this page and staple it to your homework papers .
5.6 #11,12,16,17,20,39 ( during eighth year means bet
Math 3B Lecture 1 Winter 2015
due Friday March 6
Late homework is NOT accepted .
at 8 am .
HW # 7
Name _
Section
A
B
C
D
(circle one )
UCLA ID # _
Print this page and staple it to your homework papers .
6.1 # 2327,2831,35
6.2 # 30,36,40
6.3 # 2,8,14,26
not the same, so
no .
k=1
k=2
for different values of k, you
get anther solution.
y=k(t+1) +6 is a "family" of
solutions
y(0)=8





PG corrections, I "lost " a negative when
we took the antiderivative .
Math 3C HW #1 due Monday April 6 at 8 am. NO late homework.
Name _ Section _
UCLA ID # _
Print this page and attach it to your homework papers. Homework papers must be
stapled. Do not turn in homework that is not legible or has scratch out marks on it. BE
Math 3B Lecture 1 Winter 2015
NOT accepted .
due Friday January 16 at 8 am . Late homework is
Name _
Section
A
B
C
D
(circle one )
UCLA ID # _
"Practice problems"are for you to practice your skills. These are NOT collected .
"Turn in problems" must be wri
Math 33B: Dierential Equations
Homework 2: Mixing problems & Exact ODEs
Due on: Mon., Jan. 27, 2014 
3:00 PM
Instructor: aliki m.
Please include your name , UID and discussion section on the submitted homework.
Note: Just for this weeks homework, the de
2. [20pts] Vectors and functions
Write a function called same_elements. This function takes as arguments two vectors of ints,
v1 and v2. It should return true if all elements of v1 are found in v2 in any order and false if
v1 contains an element that is n
Questions 3 and 4 refer to the following class:
3. [20pts a) 10pts, b) 5pts c) 5pts] Classes
A class called Athlete has as private variables a string called name and a vector of doubles
called run_times. It has a default constructor and a regular construc
4. [20pts] Classes continued
a) Write the operator member function < for the Athlete class. If A and B are Athlete
objects, the expression A < B should be true when the run_times vector of A contains an
element that is smaller than all elements of the run
1. [20pts] Short answer. Vectors and random numbers.
a) Assume a vector v of ints has been previously filled. Write the code that outputs to the
console the contents of a random slot in vector v.
cout < v[rand()%v.size()];
b) A vector of ints is called li
5. [5pts] Bonus. This is a bonus question. Work on this only after you have finished
everything else. It is only worth 5 pts.
Write a function called is_subvector. This function takes as arguments two vectors of ints
v1 and v2. The function returns true i
2. [20pts] Classes
Write the definitions of all member functions and constructors for the TwoDice class.
TwoDice:TwoDice()
cfw_
dice1=1;
dice2=2;
TwoDice:TwoDice(int d1, int d2)
cfw_
dice1=d1;
dice2=d2;
void TwoDice:roll()
cfw_
dice1 = rand()%6 + 1;
dic
3. [20pts]
We will try to solve the following problem with a computer simulation: Throw two dice
repeatedly until the cumulative sum is odd. On average, how big is this sum? Implement this
problem in a similar way as we did the craps problem in class. Not
4. [20pts]
a) Write a loop that runs 10 times. Each time the loop runs, create a TwoDice object, then
call the roll member function and store the object in a vector v.
vector <TwoDice> v;
for(int i=0; i < 10; i+)
cfw_
TwoDice D;
D.roll();
v.push_back(D);
Note: Questions 14 relate to a class called TwoDice. Question 5 is an optional bonus
question.
1. [20pts]
Write the class declaration for a class called TwoDice. The TwoDice class has two data
fields: int dice1 and int dice2. It has a default constructor
Math 33B: Dierential Equations
Practice problems 1
ANSWERS
Instructor: aliki m.
Problem 1
y (x) =
1
4 3x2
2
2
The solution is dened within < x < .
3
3
Problem 2
y (x) =
ex2
2
+1
Problem 3
(i)
y
dy
=6 ,
dt
25
y (0) = 75
(ii) At t = 25 ln 3 mins ( t 27.47
Math 3C Hw # 5 due May 1
Name _ Section _ ID _
PRINT this page to use as a cover sheet. Staple your papers or use a paper clip.
1. You abet $4 , you roll a single die and you get back $1.10 times the number on the dice .
What is the average win/loss for t