Blog, ECS 256, Fall 2010

Sept. 24, 2:41 p.m.

Correction to the syllabus: The last day of class is December 3. Our final exam will be held on that date.

Sept. 24, 10:41 p.m.

The first few problems (about half) of Homework I is now on our Web page.

Sept. 27, 9:41 p.m.

In Problem 4 of the homework, the requested error rate is for the received bit stream as reported by the "majority rule" policy.

Sept. 29, 4:15 p.m.

There were two students who talked to me after class today about getting into a Homework group. Both said they would send me e-mail, but only one has done so. The other should contact me right away, even if he has already joined a group.

Remember, the syllabus says:

You must submit to me your group membership lists by 11:59 p.m. of the day of the third lecture.

Sept. 29, 4:17 p.m.

Our first Quiz will be held either on Wednesday or Friday of next week. If there is a strong objection to one of those dates, please let me know immediately.

Sept. 29, 9:24 p.m.

The remainder of Homework I is now on the Web.

Sept. 30, 5:47 p.m.

You are required to use the article class in your LATEX  documents. You are allowed to use any classes in addition that exist on the CSIF machines if you wish.

Oct. 1, 8:30 a.m.

We'll have Quiz 1 on Friday, October 8.

Oct. 1, 8:30 a.m.

When you submit Homework that is due in two phases, such as is the case now, title your e-mail message "HwknAX" and "HwknBX," slightly different from what it says in the syllabus.

Oct. 4, 2:30 p.m.

Good news! "Ahmed's Theorem" is valid! And it has a good intuitive explanation.

Theorem: In the ``trapped miner'' example, Section 5.7.6, replace 2, 3 and 5 by a, b and c. Then the expected time to escape the mine is a+b+c.

Proof: Let N denote the total number of attempts the miner makes before escaping (including the successful attempt at the end), and let Ui denote the time spent traveling during the ith attempt, i = 1,...,N. Then

E(T) = E(U1 +...+UN) = E[(U1 +...+UN)|N] = E(U1) EN

N has a geometric distribution with p = 1/3, so EN = 3. And E(U1) = (a+b+c)/3.

QED.

In other words, intuitively: It takes an average of 3 attempts to escape, with mean time of (a+b+c)/3, so the mean time overall is a+b+c.

Oct. 4, 2:49 p.m.

Include your R code for Homework assignments in two ways:

For LaTeX, use the listings package. Here is an example:

\documentclass[11pt]{article}

\usepackage{listings}

\begin{document}

abc

\begin{lstlisting}[numbers=left]
mapsound <- function(df,cols,sourceval) {
   fromcol <- cols[1]
   tocol <- cols[2]
   base <- which(df[[fromcol]] == sourceval)  
   basedf <- df[base,]  
   # determine which rows of basedf correspond to the various mapped
   # values
   sx <- split(1:nrow(basedf),basedf[[tocol]])  
   retval <- list()
   retval$counts <- sapply(sx,length)
   retval$images <- lapply(sx,function(mappedvec) basedf[mappedvec,])
   return(retval)
}
\end{lstlisting}

de

f

\end{document}

Oct. 6, 2:49 p.m.

Our Quiz on Friday is guaranteed to include one or more of the following exercises in the textbook: Chapter 3, Exercise 19; Chapter 4, Exercises 9, 13 and 15; Chapter 5, 29, 30 and 37. Let me know if you need help with these.

Oct. 9, 11:24 p.m.

As I mentioned in class, my proof of Ahmed's Theorem was incorrect. I've fixed it now:

Given N, we have Ui = 3 or 5, with probability 0.5 each, i = 1,2,...,N-1, and UN = 2 with probability 1. Also, as mentioned earlier, EN = 3. Thus

E(T) = E(U1 +...+UN) = E[(U1 +...+UN)|N] = 0.5 (3+5) E(N-1) + 2 = 10

Oct. 10, 10:50 p.m.

I've finished grading Quiz 1. I knew when I composed the quiz that it was long and rather difficult, and I did not expect to see high scores. But the results were more mixed than I had anticipated:

Please recall a message on this blog on October 6, which said:

Our Quiz on Friday is guaranteed to include one or more of the following exercises in the textbook: Chapter 3, Exercise 19; Chapter 4, Exercises 9, 13 and 15; Chapter 5, 29, 30 and 37. Let me know if you need help with these.

Problem 2 on our quiz came from that list (Chapter 5, Exercise 29). In other words, Problem 2 was meant to be a "free gift" of 20 points. This presented me with a vexing dilemma: In order to encourage students to do well in this difficult class, I don't like giving a quiz grade lower than B, but on the other hand, I also expect students to do their part and heed the messages on the blog.

Tomorrow (Monday), I will go over the quiz in class, and discuss strategies for studying in this class.

Please review the grading mechanisms in our course syllabus. The homework counts 40% of the course grade, and I assume everyone will get an A there, so that is a good start. The quizzes also count 40%; for those students who scored under 20 on Quiz 1, I will consider possibly reducing the weight of that quiz in the final course grade if those students show marked improvement in later quizzes.

Oct. 11, 10:50 p.m.

Homework II is now on the Web. Note that Problem 5 uses the dreaded "M word." :-) Actually, it's not as bad as it looks.

Oct. 12, 1:38 p.m.

I've added an update to the update problem in the homework (Problem 5), consisting of writing R code.

Oct. 13, 10:32 p.m.

I have changed Problem 4. The reason is that I decided the solution to the original problem was too long, too messy, and too reliant on calculus tricks.

Oct. 13, 10:38 p.m.

Some hints:

Oct. 13, 10:48 p.m.

If you are already in a specific research field (security, networks, bioinformatics, etc.), or are anticipating one, please let me know, as I may give more emphasis to certain parts of the book accordingly.

Oct. 14, 3:57 p.m.

ARGHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!

The syllabus says, "In order to facilitate grading, I will require homework submission to be done exactly according to the following rules..." I explain that I need this in order to write a shell script to print out your homework and do other processing. I am astounded to find that CS grad students--who know that, say, omitting a comma in a program means it won't compile--cannot follow simple instructions.

I've received misnamed files, .rar files (!), and in one case, no packaging at all.

Some of the groups have complied with the rules, thank you, but in some cases I still cannot print their PDFs. This may or may not be their fault, but it's odd. For instance, some of them are in gzip format.

Please resubmit both of your Homework I files (even if you did everything correctly the first time), following the rules exactly. Also, make sure that your .pdf files are viewable by xpdf on the CSIF machines. Thank you.

Oct. 14, 10:57 p.m.

We will have Quiz II next Friday, October 22.

Oct. 15, 2:47 p.m.

There may be a typo in Problem 5. But I don't have time to check it now, so I'm postponing the due date until Monday.

Oct. 15, 9:33 p.m.

The entire homework due date is postponed until Monday.

Oct. 15, 10:39 p.m.

I've fixed the typos in the statement in Problem 5, and have added a hint.

Oct. 15, 11:02 p.m.

Once again, please make sure to follow the directions precisely when you submit homework. The syllabus says,

Do NOT make a subdirectory. My automated shell script will apply tar xf to your .tar file and will then expect to see your files as listed above.

If you did not follow this particular rule for Homework II, don't resubmit; I'll just fix it myself by hand. But please adhere to this rule in the future. Thanks.

Oct. 19, 5:20 p.m.

Our Quiz on Friday is guaranteed to include at least one problem from the following exercises in our book: Chapter 5, Exs. 14 20; Chapter 10, Exs. 1, 2.

Oct. 21, 5:12 p.m.

In your LaTeX writeups, please do a professional job. The symbol * means multiplication only in programming, not in mathematics. Use juxtaposition or \cdot.

Oct. 21, 5:19 p.m.

If you encounter any problems in working in your groups, please let me know.

Oct. 21, 8:49 p.m.

The hint in Exercise 14, Chapter 5, was badly phrased. I've improved it now:

Hint: Write X = X1 + ...+Xr , where Xi is 1 or 0, depending on whether module i of A is correct. Of those, let X1 , ..., Xc correspond to the modules in common to A and B. Similarly, write Y = Y1 + ...+Ys , for the modules in B, again having the first c of them correspond to the modules in common.

Oct. 21, 8:49 p.m.

I just finished grading Homework I.B. Basically all groups did well on Problems 5 and 6, but some did not get Problem 7 right. The latter groups encountered a mismatch between then analytical solutions and their R simulations; these groups received a B grade. The other groups received an A grade.

Oct. 22, 10:49 p.m.

I have just put up the solutions to Quiz 2 on our Web page, in this directory. Please make SURE you read the solutions, as they may appear on future quizzes.

As I've mentioned, I try to put exam problems in order of difficult, so I intended Problem 5 to be difficult. But I think you will be shocked at how simple the solution is.

Oct. 22, 11:49 p.m.

Problem 1 of the new homework is now on the Web. More coming soon.

Oct. 23, 10:19 a.m.

I've finished grading the quizzes.

Overall I was pleased with the results. The high score was 70, to which I assigned an A+ grade. There were several in the 60s, which got A grades. The most common score range was 47-59; I gave these scores A- grades.

The B grades went down as far as 30, with 24 getting a B- grade. Unfortunately, there were two scores below that.

If you would like to know your grade before Monday's class, please send me an e-mail message.

Oct. 23, 3:45 p.m.

Problem 2 is now on the Web.

Oct. 24, 4:51 p.m.

The rest of Homework III is now on the Web.

Oct. 25, 8:21 p.m.

Various news items:

1. I've fixed the error in my solution for Problem 1 of the quiz. If you were docked points because you wrote 1/[1-(1-q)^n], I will add the points back and change your grade. If you got full points, don't worry; I will not deduct points now. :-)

2. In Problem 1(c) in the homework, choose a few sets of values of p, q and b. This is a general rule--if you are using simulation to confirm a theoretical results with general parameter values, choose some values for your simulation runs.

I am considering grading at least some of the homework assignments interactively, i.e. with all members of a homework group present. I would ask followup questions to each group member. If you have any views on this, pro or con, please let me know.

Oct. 26, 3:03 p.m.

In Problem 1, if an item enters and leaves in the same slot, its wait is 0.

Oct. 27, 9:45 a.m.

I will need to end my office hour early today, at 5 p.m. This is for today only.

Oct. 29, 11:03 a.m.

I've fixed the error in the balance equations in the migration model, as discussed in class.

Oct. 31, 4:45 p.m.

There was a typo in Problem 2. Graphs are directed.

Nov. 2, 5:53 p.m.

I've filled in the steps for (10.86). Please make sure you understand the reasons.

Nov. 3, 4:53 p.m.

Our next quiz will be held on Nov. 17.

Nov. 3, 5:13 p.m.

I've added reasons to the steps in the computation of the autocorrelation function for a Poisson process.

Nov. 3, 11:33 p.m.

As mentioned, one of the problems in your next homework will be complex program that I'm assigning to ECS 132 as well. You can find it here If you do not have experience with DES, this program will not be easy. It's very important to START NOW.

Nov. 5, 4:58 p.m.

I'm putting up Hwk IV now.

Nov. 5, 11:21 p.m.

OK, Hwk IV is all set.

Nov. 6, 1:06 p.m.

I had forgotten to remove the LaTeX links in the DES.R file. I've done so now, and have also separated the example application, the M/M/1 queue model, into a separate file MM1.R..

Nov. 6, 5:06 p.m.

I just made a change to DES.R and MM1.R, shifting code from the former to the latter (as it was application-specific).

Nov. 6, 9:36 p.m.

We will not have class on Monday, Nov. 15.

Nov. 6, 10:27 p.m.

I changed the third part of the output in Problem A in order to make the program easier. Still difficult, though.

I've simplified Problem A a bit, by having bus speed set in terms of stops per unit time.

Nov. 7, 6:07 p.m.

I've added another piece of advice on Problem A, and have made a minor correction regarding the run time.

I'll be posting test values soon.

Nov. 8, 10:59 p.m.

In addition to no holding class on Nov. 15, I forgot to mention that I will not be on campus at all (giving 2 talks at UCB), thus will not hold office hours. I will be available by e-mail later in the day.

Nov. 10, 9:31 p.m.

I've moved the due date for the entire assignment to next Tuesday.

Nov. 11, 12:04 a.m.

I put in some test cases in Problem A.

Nov. 11, 3:39 p.m.

There was an error in the posted timings for Problem A, fixed now.

Nov. 12, 9:05 a.m.

Next Wednesday's quiz will almost certainly include questions involving DES.R. I will be distributing copies of the code in class today, but if you miss class, you can download from here. Note that this file contains line numbers, which would be referred to in quiz problems, so you do need this version.

Nov. 12, 11:18 a.m.

A student asked how the first test case in Problem A could have an average number of riders larger than 2, specifically 2.001, since the bus capacity is 2. The answer is that that basically is a roundoff error. I had a statement

cat("mean number on bus:",totriders/(totbusloops*nstops),"\n")

in my code. This is a little sloppy, as it does not account for the final partial loop in the simulation, but in the long run it doesn't matter, so for convenience I wrote it that way, resulting in a value slighlty larger than 2.

By the way, I've now added a third test case. The first one is not very good, because it represents an unstable situation: Passengers are arriving at a rate more than the bus can handle, so the queues keep getting longer.

Nov. 16, 5:02 p.m.

I'm extending the due date to Thursday, since I had no office hour yesterday.

Nov. 16, 11:14 p.m.

I just changed Problem 2 to an easier version.

When I wrote up this homework assignment, I was concerned mainly with Problems 1 and 3. I very carefully wrote out a solution for 3, and confirmed by simulation, and I spent a long time writing the code for 1. Problem 2 was, I must apologize, a casualty of my fixation on the other two problems, resulting in my not thinking it through carefully.

Problem 2, in its original form, boils down to an interesting combinatorial problem. I suspect that a closed-form solution does not exist. However, if you do think of one, I will give copious Extra Credit.

Nov. 18, 9:10 a.m.

We are, sadly, running out of time. There is so much more in probability and statistics that I'd like to tell you about! Anyway, here is our plan for the rest of the quarter:

Nov. 22, 8:17 p.m.

I've finished grading the quizzes. If you wish to know your grade before tomorrow, just send me an e-mail message. The solutions are on our Web page.

Nov. 29, 9:55 p.m.

In the revised book, I've added a lot more detail (reasons for steps, etc.) to the material on pp.203-205 in the original book, and moved the premature bias example on p.202 to a place following the section on bias.

Nov. 30, 8:55 p.m.

I must apologize for falling so far behind in the grading of your homework. I will finish the grading this coming weekend.

On the subject of homework, I need to have an e-mail message from each of you individually, giving me a frank assessment of your contribution to the homework activities of your group. Please give me a single number for the quarter (not one number for each homework assignment), expressed in the range 0-100%. For instance, if there are three people in your group, and you all contributed equally, you should report 33%. Thanks in advance.

Nov. 30, 9:05 p.m.

A student asked:

But where is n0.5 in equation 9.45, page 267, as [in] page 170? Shouldn't it be 1.96*142.6/(100)0.5 in that equation?
Here is my answer:
The standard error of an estimator is the estimated standard deviation of that estimator. This already incorporates sample size. For instance, in the regression case on p.267, the standard error comes from (9.44). The latter has a term (Q'Q)-1. Q'Q consists of various sums of products of the X values, and the larger n is, then the larger the elements of Q'Q are. So, (Q'Q)-1 already has something like a "1/n" factor in it.

Dec. 1, 10:03 p.m.

As mentioned in class today, try to get to class early on Friday. If everyone arrives early, we can start early.

Dec. 3, 2:43 p.m.

A two or three of you still have not responded to my request the other day:

On the subject of homework, I need to have an e-mail message from each of you individually, giving me a frank assessment of your contribution to the homework activities of your group. Please give me a single number for the quarter (not one number for each homework assignment), expressed in the range 0-100%. For instance, if there are three people in your group, and you all contributed equally, you should report 33%. Thanks in advance.

Please respond soon, as I will need it when I determine grades for the course. Thanks.

I'll have news on today's exam later today.

Dec. 3, 9:53 p.m.

Here is the bad news (maybe good news): I made a major error in Problem 1 on today's exam. It should have stated that the conditional distribution of Y, given X, is β1 X. Note the X!

This is the kind of error which one can look at a million times and yet still not notice. Of course I apologize for it. On the other hand, the error should have been self-correcting--all of you should have noticed, because the problem doesn't make sense without the X. The problem talks about X being the single predictor variable, implying regression, and repeatedly refers to the conditional distribution of Y given X--yet, the problem as stated has the conditional distribution of Y given X being independent of X, clearly wrong. One group did seem to sense a bit that something was not quite right, but didn't think my (incorrect) answer was odd and accepted.

Meanwhile, no group did very well on Problem 2. One group did at least get the A matrix correct, and another got it half-correct. But no one was able to go further than that.

I've put the solutions on our Web page. When you see them, you'll discover that both problems were pretty difficult.

So, I am not counting this exam in the grade, and will increase the weight of the quizzes accordingly. I'm giving Extra Credit to the group that got the A matrix right in the exam.

I wish to emphasize that the exam was not wasted at all. Recall that at the start of the exam, I said that it may turn out that no group does well on either problem. So I was prepared for that possibility, and felt that the exam was worth doing anyway, for a couple of reasons: First, it gave me a chance to see how your groups were interacting with each other, very important to me. Second, I was prepared to give major, major Extra Credit to any group that fully solved just one of the problems.

I know you worked very hard in this class, and I believe that you all learned a lot. I enjoyed teaching it very much. Everyone have a nice "Winter Solstice" break!