Math 362 Fall 2009
New Announcements
- Extra credit problems
are here. Please read
the README file for the
rules!
Old Announcements
- The PDF file lecture12.pdf
contains the example discussed today in class which should
help with Problem 4.24.
- Here is the consent
form to change the date of the final exam
-
Midterm 2 solutions are available here!
Links
Resources
Frequencies of letters and diagrams in English
Follow this link for a concise summary.
Practice exams
Assignment 0 - due September 9, 2009
- Read all sections up to 2.4.
- Be able to solve all exercises in section up to 2.4.
- Prepare for a 15-minute quiz on homework excercises to be
given on Friday, September 11, 2009 at the beginning of the class.
(The result of the quiz will be applied towards your homework score,
and will be worth the same as any other homework assignment.)
Assignment 1 (due Wednesday, September 23)
- Problem 3, 5 and 8 of Practice Midterm #1.
Please pay special attention to describing the sample spaces involved.
For problems 3 and 5, they should be expressed in terms of sets,
subsets, tuples, functions, etc. For Problem 8, you should use the tree
approach. Purely numerical answers without clear connection with the
sample spaces introduced will not count as full credit.
A note on credit for homework assignments
Credit for this assigment will be that of a regular assignment. You
should assume that there will be approximately 10 homework
assignments, but the exact number may be slightly different. All
assignments count evenly towards the final grade, unless explicitly
specified. The first quiz counts as a regular homework assignment.
Assignment 2 (due Friday, October 2)
- Section 2.6: 2.27, 2.29, 2.36, 2.40, 2.42, 2.43, 2.47.
Assignment 3 (due Friday, October 9)
Use R to solve the following problem:
You have 5 pennies and you play a game against an opponent who has
an ulimited amount of money. You toss one of the pennies and if it
lands heads up, the opponent gives you 2 pennies. If it lands tails
up, you give him a penny. The game ends if you go broke, i.e. have
no money. What is the probability that you will lose?
How would the probability change if you had more money, for instance,
10, 20, 30, 40, 100 pennies?
Hint
You may use the following R functions:
- sample
- cumsum
- min
- which
- length
Also, you need to know how to build sequences using ":" and
construct "for" loops.
Turn-in Instructions
The primary part of the solution should be an R program that prints the answer to
the problem (a single number, the probability). The program should reside in a file
with extension .R or .r. When studying a variable amount of money, please do
not copy or cut-and-paste your programs. Instead, use functions to implement
common functionality. For instance, a function
prob(money=5)
could be used to print the answer for variable amount of pennies. When called
with no parameter:
prob()
it will then print the probability for 5 pennies.
Please do not put your program in a Word document. It should be a plain text
file, that can be understood by a plain text editor, such as Notepad.
Please supply a write-up summarizing your conclusions and observations.
It can be a part of the script, included as comments, or it can be
a separate document. The document should be either a plain text document
(see above) or a Word document, or a PDF document.
Once you have prepared your files, please create a Zip archive
containing all files and suitable to be e-mailed as an attachment.
Finally, before the due date (9am on Friday, October 9), please submit
the Zip archive by e-mail as an attachment. It is paramount that you
use this specific line as the subject line:
math362_homework_3_submission
Special Assignment (due Monday, October 12 before class)
Carefully write up a solution to problem 2.47 of Homework 2.
Credit
The credit for this assignment is 5, which will be added to
the result of Homework 2, up to a maximum of 35 points.
Assignment 4 (due Friday, October 16)
Chapter 2, Supplementary Exercises:
2.54, 2.55, 2.68, 2.69, 2.70, 2.73, 2.77.
Section 3.1: 3.1, 3.7.
Plotting c.d.f. with R
Plot the c.d.f of the number of runs in a sequence of two kinds of
items (say good and defective) for m=20 good and n=30 defective
items.
Important: Please submit the program and the plot as hardcopy with
the rest of your assignment.
Assignment 5 (due Wednesday, October 21)
Section 3.2: 3.11, 3.12, 3.18, 3.21.
Assignment 6 (due Friday, October 30)
- Section 3.4: 3.24, 3.28, 3.37, 3.38.
- Section 3.6: 3.40, 3.48.
Computing the binomial distribution with R
Many of the problems involve labor-intensive calculations. You
should perform the calculations of the binomial distribution with R,
as to avoid wasting time on simple arithmetic. You will find the
necessary information in lecture notes. The important R functions are:
- dbinom for calculating the probability function (called the
"probability density function" in the R manual).
- pbinom for calculating the cumulative distribution function
(called simply "distribution" by the R manual). Note that the argument
lower.tail=FALSE will give you the probability P(X≥x)
of the upper tail of the distribution.
Important instructions
Please submit the hardcopy of the scripts you are using,
or the printouts of the R sessions. However, your solutions should
make sense without the R portions. Thus, explain all sums you are calculating,
with proper summation limits. Copy the summation results from R into
your homework and clearly state that you obtained them with R and
point to the relevant portions of your R code.
Assignment 7 (due Friday, November 6)
- Section 3.7: 3.54, 3.55, 3.57, 3.61, 3.66
- Section 3.8: 3.70, 3.77
- Section 3.10: 3.84, 3.85, 3.89
Additional instructions
The same instructions apply as those of assignment 6, in regard to
using R and hardcopy, except for different distributions. Please look up
in the manual the following commands pertinent to specific distributions:
- dnbinom/pnbinom for negative binomial
- dhyper/phyper for hypergeometric
- dpois/ppois for Poisson
Please note that the R functions are ogranized into quartets, each quartet responsible for the four basic functions:
- Computing the probability function ("d" functions).
- Computing the cumulative distribution ("p" functions).
- Computing the inverse of the distribution F(x)("q" functions, the
quantile functions). The quantile function allows to solve the
equation F(x)=p for x, given p.
- Generation of random samples with a given distribution ("r"
functions). Useful in Monte Carlo simulations.
Assignment 8 (due Monday, November 16)
- Section 4.1: 4.2, 4.7.
- Section 4.2: 4.9, 4.13.
- Section 4.3: 4.20, 4.24.
-
Please read carefully Section 4.4.
Please pay special attention to the calculus that you may have
forgotten, and have questions if unable to fully understand
the text.
Additional instructions
As for assignment 7.
A note on R and the uniform distribution
The quartet of R functions supporting uniform distribution
is: dunif, punif, qunif and runif.
Assignment 9 (due Friday, November 20)
- Please read the parts 6.1-6.3 which
are relevant to one random variable transformations.
This material is covered in
lecture12.pdf
slides.
- Slides
lecture11.pdf
contain a method of computing the moments
of the exponential distribution using the gamma function,
which significantly reduces the size of some calculations.
- Slides lecture13.pdf
contain an example of a gamma distribution application discussed
in class.
- Section 4.4: 4.30, 4.35.
- Section 6.2: 6.2, 6.4.
- Section 6.3: 6.10.
- Section 4.5: 4.45, 4.47, 4.50
- Review the R quarted for the normal distribution: dnorm,
pnorm, qnorm and rnorm.
Additional instructions
As for assignment 8.
Assignment 10 (due ???)
- Review the R quarted for the normal distribution: dnorm,
pnorm, qnorm and rnorm.
- Section 4.6: 4.55, 4.56 (use qnorm instead of table IV).
- Section 4.6: 4.57.
- More problems to come...
Additional instructions
As for assignment 9.