Fall 2016 Computer Science 458 Lecture 3: 9/07/2016
Per piazza posting, Jieung Kim office hours: Monday and
Wednesdays, 5:30 pm to 7:30pm. AKW 311.
Note: he will hold hours on Monday (Labor Day) even though class
does not meet. However, he may be travelling on Wednesday, 9/7.
Here are some comments about the grading criteria
1. Both function1 and function2 should print out the results (each
line contains a single word), instead of returning them.
2. For function2, as shown in the example, the target word should not
be included in the result.
3. For both functions, the case doesn't matter.
"Male" should be in the same group with "male" or "alme".
4. You can print any largest set, but not both.
5. For both functions, the program should ignore the characters other
than "a -z", "A- Z" and "0-9".
By the way, the test cases we use are similar to the examples. The
main goal of this homework is to test how well do you know Python and
R. We will not use lots of corner cases to defeat your program. Hope
Do not use the Classes server dropbox. !!
Bottom line: we are not trying to create lots of gotcha cases. This
is not a software engineering course. We want you to attain
conversational fluency in R and Python. We do not expect you to be
able to write bulletproof code.
Demo: swirl, r studio
Introduction to Decision Making
For discussion in last class: reasons for and against each
of the following:
We assume that you have relationships with a variety of people:
family, friends, colleagues, classmates, etc. Also discuss who among
them will be affected by your choice, either positively or negatively.
- Getting a tattoo.
- Voting for each of the presidential candidates.
Decision taxonomy (possible components of a data structure)
- Stakeholders. Need to incorporate the views or reactions
of people who are or will be affected by the choice. For the tattoo,
this group includes friends, relatives, future employers, future
spouse and in-laws, and future children.
- Consequences. What happens if you make a choice?
What are the results? The consequences of getting a tattoo are
likely more long lasting than the consequences of getting drunk.
Although, you could get drunk, cause a car accident that results in
serious injuries or death. This is a case of causality in reverse:
the prospect of future outcomes alters the decisions you make today.
- Explanation. What are the reasons behind your decision? How
would you explain or justify the decision? Would you have a different
explanation for different people or at different times?
- Cost / Resources. What costs are associated with the decision?
How expensive is the tattoo, pace Professor Spielman and the
Petersen Graph? Costs need not be limited to economic costs. Other
resources include time, agent relationships (asking a friend for a favor),
reputation. Businesses explicitly consider the reputation risk associated
with decisions. (How would this look on the front page of the Wall Street
Journal?) See next.
- Risk. What risks are associated with the decision? Broadly
speaking, this is another kind of cost. What if you make a mistake,
and get the wrong Chinese character?
Is it possible to mitigate the
risk? For example, can you remove a tattoo?
Every risk raises the question of a mitigation strategy. Removing
a tattoo is an example. How does the presence or absence of a mitigation
strategy affect a decision?
Also, someone observed
that the quality of the tattoo will degrade over time. The
same could be said for your Yale education. Upon reflection, I believe
that for most alums, their Yale experience improves with age. They
do not have an eidetic or photgraphic memory. Personally, I have a
- Precedent. Past decisions provide justifications for
future choices. There is a presumption of consistency in decisions.
Some people always vote for the Democrat.
- Societal Norm. A lot of decisions are explained by saying
that this is the normal course of action. For example, a sailor
would not be questioned for getting an anchor tattoo. Norms can be
seen as a case of strong precedents. Also, different societies have
- Emotion. Sometimes the decision seems to be driven
of the affect or emotion involved. Getting a tattoo can be impulsive,
like buying candy at the checkout counter.
- Principles, Ethics, Beliefs, Religion. Getting
a tattoo can preclude your admission to a Jewish cemetary. There are
constellations of principles that can impinge on decisions.
Economic Decision Theory