Blog, ECS 132, Winter 2021

Saturday, January 23, 12:30 pm

ECS 132 news items:

Friday, January 22, 6:30 pm

Somehow the quiz for Sec. 2 is not up. We will do two quizzes for Sec. 2 next week.

Friday, January 22, 2:25 pm

As noted before, even if a homework problem asks you to find a probability, expected value etc. analytically (i.e. math), you should still write simulation code for your own benefit, to check your math.

In Problem 4, I have the opposite advice: Use an analytical solution to check your simulation code. I've added a couple of examples to the problem writeup.

Friday, January 22, 2:20 pm

Homework submission information on CSIF, per Arnav. Use the handin app:

handin acharyya hwk1

Friday, January 22, 9:40 am

In order to give you exposure to more examples involving expected value and variance (Problem 5), I'm moving the due date of Hwk 1 back to 1/27.

Wednesday, January 20, 11:20 pm

Keep in mind, the quiz policy is just like that of the homework. If a problem asks for a probability, expected value etc., it means the exact answer is required; do not do simulation unless it is specifically requested.

Please MAKE SURE you are mindful of the blog post of Thursday, January 14, 7:45 pm, especially the point about NOT simplifying math answers.

Wednesday, January 20, 7:10 pm

In a discussion of Problem 1a in the OH today, a student said his solution steps led him to finding

P(X1 + X2 ≥ 4 | X1 ≤ 3 and Y1 ≤ 3)

where Xi and Yi are Jill's and Jack's ith rolls, respectively. (Note that for instance X2 is undefined if Jill wins on the first turn.) He was unsure where to go next.

Well, first, we have that

P(X1 + X2 ≥ 4 | X1 ≤ 3 and Y1 ≤ 3) = P(X1 + X2 ≥ 4 | X1 ≤ 3)

Now, what to do with that? Rewrite it as

P(X1 + X2 ≥ 4 | X1 = 1 or X1 = 2 or X1 = 3)

Then use P(B | A) = P(A and B) / P(A) etc.

The message is, Don't give up! Persistence is key! Your solution may turn out to be rather lengthy in some cases.

Wednesday, January 20, 7:10 pm

I'm still seeing a lot of students try to intuit their way into solutions to the probability problems. Yes, intuition is highly important, but it will often lead you astray if you don't couple it with detailed, step-by-step use of the mailing tubes.

Wednesday, January 20, 7:00 pm

Someone asked whether numerical values will be announced for the math problems in the homework, so you can check your work. As I explained a couple of times in the blog and in class, what I prefer is that you write simulation code for the purpose of such checks (even if the problem doesn't ask for simulation code).

It may be that you find that your math and simulation answers don't match. Carefully go through each, and if you can't find the reason for the discepancy, contact a TA or me.

Note that simulation gives only approximate answers, so the math and simulation answers will not match perfectly. Try a much larger value of nreps if you are concerned that the difference may be due to a logical error. The discepancy should diminish.

Tuesday, January 19, 9:40 am

Homework news:

Monday, January 18, 9:00 pm

News items:

Friday, January 15, 8:40 pm


As explained in our course syllabus, all my files recording your grades on quizzes, homework and the term project are indexed by your official UCD e-mail address (which is the address I've been using in my e-mail messages to you). If you use some other e-mail address, in effect we have no record of your work! This is not good. :-(

Keep in mind that this is an issue not just for quizzes, but also for homework and term projects. Note that in the latter two cases, you work in groups. For instance, your group makes just one submission for the group, not one for each group member. That means that the person who submits the homework or term project must make sure that the e-mail address for each group member is correct.

Friday, January 15, 3:55 pm

There has been a change in office hours. Arnav will take over for Shubham. See our "course at a glance page for details. Shubham is still one of the TAs, so you can still e-mail him etc.

Friday, January 15, 2:05 pm

Make sure you understand R's *apply() functions. None is absolutely necessary, but they can simplify your work quite a lot.

Reminder: All blog posts are considered part of your official course materials. Be ready to use the *apply() functions on quizzes.

Thursday, January 14, 7:45 pm

Some tips to remember for Quiz 1 next week and all subsequent quizzes:

Thursday, January 14, 12:30 pm

Someone asked whether it's OK to use '=' instead of '<-' as your assigment operator. The answer is "usually." There are situations, e.g. this one, where it may give you the wrong result or even generate an error message.

On the principle of "better safe than sorry," I do urge you to use '<-' for assigment. And I urge you to put a shortcut into your text editor's startup file. For instance, I have this line in my vim startup file:

map! eqq <- 

Then every time I want the "left arrow" assignment operator, I simply type 'eqq'. No hunting on the keyboard for '<','i, '-' or even '='.

Wednesday, January 13, 2:50 pm

Shubam will hold a special OH today re OMSI, 4 pm.

Tuesday, January 12, 11:00 pm


Tuesday, January 12, 9:55 pm

Concerning office hours (TAs and myself):

Tuesday, January 12, 4:50 pm

CRUCIAL instructions for taking quizzes. Follow these TO THE LETTER!

  1. Make sure you have thoroughly tested OMSI, playing the roles of both student and instructor.
  2. In your above tests, do at least one in which the server is running on CSIF, which will be the case during quizzes. Note that that means you must be running the UCD VPN.
  3. The server host and port for your quiz will be shared with you in separate e-mail message, the day before the quiz. DO NOT SHARE THESE WITH OTHER STUDENTS; doing so will result in a report to the SJA.
  4. That e-mail message will also state the start and end times of the quiz, usually a duration of 25 minutes. Of course, once the server shuts down, you cannot submit any further work. In fact, even if you submit just before the server goes down, it may not be processed by the server on time.
  5. The quiz will be hosted during the discussion sections. You must take the quizzes in your enrolled discussion section.
  6. As your discussion section is about to start, enter the Zoom session for that section, via Canvas. The TA will start the server at the appointed time, and you may begin the quiz.
  7. Questions from students to the TA via Chat are allowable for clarification of the quiz questions' wording. Questions about the course content, the location of items in the textbook and other course materials will be answered with a polite statement, "Sorry, I can't answer that kind of question."
  8. If you have a question during the quiz, address it ONLY to the TA, not to Everyone (the default). We may be able to disable the latter.
  9. Quizzes are open book/notes. For convenience, you may wish to use OMSI's PDF feature, as it allows searches.
  10. You are NOT allowed to otherwise access the Internet during quizzes.
  11. You are NOT allowed to communicate with anyone, in the class or not, during a quiz.
  12. Be ready for the quiz ON TIME. Clearly, with the quizzes being only 25 minutes in duration, you cannot afford to be late.

Tuesday, January 12, 8:40 am

ECS 132 news items:

Monday, January 11, 19:15 pm

This post will be about LaTeX.

LaTeX is a standard typesetting language in tech and the sciences. It was invented by a computer scientist, the Turing Award winner Leslie Lamport. It consists of a number of macros for the more basic typesetting language, TeX, invented by another Turing Award winner, Stanford CS professor Donald Knuth . It is used by most CS professors in their research. If you do research with a professor, you probably will use it. It is also the basis for math typesetting in the Wikipedia.

What tools might you use to write LaTeX?

How can you learn how to do a certain LaTeX trick, e.g. having a column of equations with the = signs lined up?

Monday, January 11, 11:55 am

I corrected the time for the last ethics meeting (earlier blog post today). It is 11:45.

Monday, January 11, 10:10 am

I've mentioned that as CS students, you should be good at using Unix (i.e. Unix-family OSs, notably Mac or Linux). This is NOT required for our course, but it's something that you should do simply as a tech expert. Note again that Intel once complained that UCD CS grads don't know Unix well.

The only way to get good at Unix is to use it in your daily life. Just because you, say, did well on Unix exam questions in ECS 36B doesn't mean you know Unix, not at all. The only way to know Unix on a practical level is to USE it, learning along the way as issues arise to be solved. If you have a Mac, fine (but use the command line a lot). Otherwise, run Linux.

And that means using REAL Linux. Any emulator, virtual machine etc. will fall short in one way or another. That includes the Windows Subsystem for Linux.

A student tried to run OMSI on WSL, and got an error message, "no $DISPLAY environment variable." That was apparently due to this problem with WSL, a great example of why WSL is not the "real" Linux, even though Linux has been installed.

But the incident shows more than just the failings of WSL. The important thing is that, as a CS student, you should know what this error message means. In fact, it was discussed briefly in my blog post of January 4, 7:15 pm, so you can see it is a common error, thus something any CS student should know about. This is an example of what I meant above in my "learning along the way" remark; this kind of daily life stuff will NOT be on an ECS 36B exam.

Using Unix on a daily basis will improve your productivity. Same for a using a debugging tool. If you learned, say, gdb in ECS 36B but are still using print statements to debug your code, you are doing yourself a disfavor. The purpose of including a debugging tool in the ECS 36B topic list is to prepare you to do effective debugging in every course from then on, NOT just to have one more topic for your final exam.

If you have a Windows machine, I recommend that you set it up to dual-boot Windows and Linux.

Monday, January 11, 10:00 am

The last ethics meeting will occur at the end of class this Wednesday, at 11:45 am. If you are in the list in the blog post below (1/10, 11:30 am), you must participate at that time. A Zoom invitation will be e-mailed to you later today.

Sunday, January 10, 11:30 am

Here is a list of students, by last 4 digits of student ID, who we believe have not yet participated in the ethics meeting:


If you did participate, please let me know as soon as possible.

Friday, January 8, 2:20 pm

I fixed a typo in the homework: d> should be just d.

On p.12 in the book, there is reference to node A and node B. This is confusing, as readers may think this is related to events A and B in, e.g., Equation (2.6). So, instead, say that we have two terminals, at which John and Mary are typing. Call the nodes Node John and Node Mary.

So, between (2.15) and (2.16), "A" means Node John and "B" means Node Mary.

Thursday, January 7, 10:55 pm

The first two problems for Hwk 1 are now on our class Web site. There may be some small changes made in the next day or so, but basically the problems are ready and you should get started now.

Thursday, January 7, 9:30 pm

Important news items:

Wednesday, January 6, 9:30 pm

Several points:

Wednesday, January 6, 3:25 pm

Ethics meetings: Those who added the course late, or who miss their assigned meeting, will be handled separately.

Wednesday, January 6, 12:15 pm

Reminder: We have our "ethics meetings" this week, during your assigned discussion sections.

You were e-mailed Zoom invitations. (In class today I mistakenly said it was via Canvas, which is not true. For this particular meeting, it is on my personal Zoom room.)

It is crucial that you JOIN THE ZOOM SESSION ON TIME. I will create breakout sessions and meet with you one group at a time, and the way I have it set up, Zoom will form breakout room groups AMONG THOSE PRESENT AT THE TIME. (Breakout rooms can be pre-assigned, but I didn't do it this way.)

After your group's meeting is done, you are free to leave.

Tuesday, January 5, 9:55 pm

Office hours for the TAs and me have now been posted, as recurrent meetings on Zoom via Canvas.

Tuesday, January 5, 1:55 pm

If you were enrolled in the course as of early afternoon today, you have been e-mailed an invitation to the ethics meeting for your discussion section THIS WEEK. Please read the instructions immediately.

As has been mentioned, this meeting is REQUIRED. You will not be able to take any quizzes (70% of the course grade) if you have not attended. Since this is your regular discussion section, you should not have a time conflict, but if you do, please contact me immediately.

Those on the class Waiting List will be handled separately, if/when you are admitted to the course.

Monday, January 4, 8:45 pm

Sorry for all the blog posts today. We of course will have more now at the start of the quarter, but once things settle down there will usually between 0 and 2 per day.

The purpose of the current post is to announce that the course syllabus is ready

Yes, it is absurdly lengthy, but it is your user manual for the course. It gives you full information on homework, quizzes, the term project, group work and grading.

Note these points in particular:

The importance of following directions correctly cannot be overemphasized. A sad example occurred one time concerning the term project, which is due at 11:59 pm the day of the scheduled final exam. (We don't have a final.) At 12:03 a.m. I received a message from a frustrated, very panicky student saying that he didn't know how to submit the project to CSIF. His teammate had been the one to submit the homework to CSIF, but he was already on a plane home. Of course, I explained what to do and didn't impose a penalty, but this student had gone through a lot of avoidable anguish.

Anyway, that's the last of the numerous messages this evening. See you Wednesday!

Monday, January 4, 7:40 pm

More on OMSI:

As you know, our first quiz will be held in Week 2. It will be a "warmup" quiz. EVERYONE should get an A+.

And MOST everyone will. Here is the distribution from my teaching the course last year:

> z <- read.table('Quiz0Grades') 
> table(z$V7)

  A  A+   B   C   D  D+   F
  1 106  20   1   9   5   1

As you can see, more than 2/3 of the class did get an A+, but about 10% got D or F grades. Those in that latter group simply didn't prepare. Some did recover and eventually get A or B grades in the course, but it certainly is a bad way to start the quarter. :-)

Remember, OMSI helps YOU get a better grade, because you can test your code and revise it if it doesn't work right. One time (pre-pandemic days), a student forgot his laptop and had to take the quiz on paper. He was very upset with himself, saying "That puts me at a disadvantage."

I've been using OMSI for 5 years now, and it works well. It's not fancy, e.g. no code syntax highlighting, but it does its job. You may wish to browse through the source code; it's complex but hopefully well organized. Good example of network and threaded programming.

Suggestions for new features etc. are always welcome, but unless they are quick to implement, they may just be filed away.

OMSI is simple to use, but you do need to read through the entire documentation. Please be patient.

Monday, January 4, 7:15 pm

During quizzes, please run OMSI on your own laptop, not CSIF (stated here, which is linked to from the OMSI docs). I have several reasons for this, but now I'd like to use this as a "Unix lesson."

A student tried running the OMSI on CSIF, and get an error message, "no $DISPLAY environment variable." Here's why:

When you use ssh to connect to CSIF remotely, you can only run text applications, not GUI. That error message is saying the CSIF machine has nowhere to display the OMSI window.

My point in bringing this up is to show an example of what "knowing Unix" means. I mentioned today in class that Intel recruiters once complained that UCD grads don't know Unix well. As you can see here, it's a lot more than just knowing the ls and cd commands. And the only way to gain this knowledge is to use Unix (Mac or Linux) in your daily life.

BTW, one can run GUIs with ssh if one uses the -Y command line option.

Monday, January 4, 2:50 pm

Re Discord:

Monday, January 4, 2:00 pm

Problems 1 and 2, especially Problem 1, in most quizzes will be very easy. I do this because I want to make sure every student who has been keeping up with the class gets some points. Thus, don't try to overinterpret a problem that you might feel is "too easy."

Monday, January 4, 2:00 pm

In sending e-mail to me or the TAs, please put '[ECS 132]' in the Subject line.

Monday, January 4, 12:10 pm

Sorry I didn't see the Chat messages. They weren't visible to me once I did screen sharing. I'll see about fixing this. Meanwhile, let's see if I can address them here.

The URL for the textbook was in one of the pre-quarter e-mail messages I sent. Those messages are archived here. If you haven't read those messages yet, read them NOW; they are crucial to your success in the course.

Re CSIF: You will need to use CSIF only for submitting the homework and term project. Make sure everyone in your group knows how to do this, to avoid disaster, e.g. unsubmitted term project and failed course grade.

Note: As mentioned over the break, as CS experts, you all should know Unix (Linux or Mac) well; Windows is for non-techies. Knowing ssh is part of that.

Nicholas asked whether the main computer in the example would hold a queue of messages in a buffer. Not in our very simple example here. And even a buffer can fill, with other messages being discarded.

Monday, January 4, 10:40 am

My office hours will be MW 4:30-5:30 pm (starting in Week 2) and by apppointment. TA office hours will be announced soon.

Sunday, December 27, 11:20 pm

Starting January 4, all course announcements will be made here.