STA 247 - Probability with Computer Applications (Sept-Dec 2004)

All term marks and the final exam marks are available here. Assignments 2 and 3 can be picked up in SS 6016A. Try phoning 978-4970 to see if I'm in.

This course is an introduction to probability with an emphasis on topics relevant to computer science. Small programming assignments will be used to illustrate applications in computer science and to reinforce concepts of probability.

STA 247 is not recommended for students who have already taken STA 107. For such students, STA 257 or STA 250 would be appropriate follow-on courses (depending on their interests).

The follow-on course to STA 247 is STA 248, which will cover statistical inference. Together, STA 247 plus STA 248 will be accepted as equivalent to STA 250 plus STA 255 as prerequisites to most higher-level statistics courses (eg, STA 302), although this was mistakenly omitted from the calendar.

There are two sections of STA 247 this fall, L5101 in the evening, and L0101 in the daytime.


L5101: Radford Neal, Office: SS6016A, Phone: (416) 978-4970, Email:

L0101: Amir Naderi, Office: SS5027, Phone: (416) 978-1063, Email:


L5101: Mondays, 6:10pm to 9:00pm, from September 13 to December 6, except for Thanksgiving (October 11). Held in Alumni Hall (AH), Room 100 (east of Queen's Park).

L0101: Mondays, Wednesdays, and Fridays, 3:10pm to 4:00pm, from September 10 to December 8, except for Thanksgiving (October 11). Held in Lash Miller (LM), Room 159.


James J. Higgins and Sallie Keller-McNulty, Concepts in Probability and Stochastic Modeling, Wadsworth, 1995.

Here is a list of typos for the book.


Final exam: 55% (Scheduled by the Faculty)
Mid-term test: 20% (Thursday, October 21, 6:30-8:30pm)
Three assignments, worth 5%, 10%, 10%.


Some assignments and exercises will involve writing programs in the R language. You can use the CQUEST computer system for this. It can be accessed from various locations on campus, or from home. Click here to request an account on CQUEST. You can also install R, for free, on your home computer (but don't expect help doing so).

STA 247 has a CQUEST page, which tells you how to use R.

Mid-term test:

Here are a stem plot and summary statistics for the test marks.

Here are the solutions to this year's test: Postscript, PDF.

Here is last year's mid-term test, with solutions: Postscript, PDF.

Final exam:

There will be no books, notes, or calculators allowed for the final exam. A sheet will be provided containing facts about the binomial, geometric, negative binomial, Poisson, exponential, and normal distributions. Specifically, formulas will be given for the probability mass or density function, the mean, and the variance for each of these distributions. You can see this sheet here, in postscript or PDF. You will also be provided with whatever tables from the back of the book you will need (eg, the table for the normal distribution). The exam will be on all the material that has been covered, including all the sections of the textbook listed below, and in particular all the material covered in the assignments and in the non-credit exercises listed below. You may need to write simple R functions, but marks will not be taken off for minor misunderstandings of R.

Last year's final exam is available from here.


Assignment 1: Postscript, PDF. Here are the solutions: Postscript, PDF.

Assignment 2: Postscript, PDF. Here are the hash functions for you to use (slightly changed 10am Nov. 8, the changes aren't critical). Here is a list of R features that may be useful for the assignment. Note: A slight error in the assignment handout has been corrected now (a "19.7%" was changed to "16%").

Here is the solution to Question 1: Postscript, PDF (Some typos corrected December 1, 9:30am).

Here is the solution to Question 2: R program, output, plots in Postscript or PDF, and discussion.

Assignment 3: Postscript, PDF. Here is a list of R features that may be useful for the assignment (updated November 30). Here is the solution: R program, output and discussion, plots in Postscript or PDF.

More detailed information on running R on CQUEST is now available on the CQUEST page for STA 247. You might want to read this even if you're not using CQUEST.

Reading list:

Chapter 1: all
Chapter 2: all
Chapter 3: 3.1, 3.2, 3.5
Chapter 4: 4.1 - 4.6
Chapter 5: 5.1, 5.2
Chapter 6: 6.1, 6.2
Chapter 8: 8.1, 8.2
We will also cover some other topics regarding computer applications, and the R language. Informaton on these topics will be provided by hardcopy handouts or on the web.

Non-credit exercises to do:

1.2-3, 1.4-13, 1.5-9, 1.6-9
2.1-1, 2.2-1, 2.3-5, 2.4-1, 2.4-5, 2.5-3, 2.6-3, 2.7-7
3.1-9, 3.2-3, 3.5-7
4.2-7, 4.3-2, 4.6-1
5.1-3, 5.1-5, 5.2-1
6.1-5, 6.2-3
8.1-3, 8.2-5

Extra things:

The Monty Hall puzzle. Here is an R program to simulate it. The program is also available on CQUEST (see the CQUEST page).

Another probability puzzle for you to contemplate.

Here is an R program for Exercise 2.5-3 (Example 2.5-4) in the book.

Here is an R program that simulates a queue.