Each week we will offer a different opportunity to explore extra topics in computer science. There will be a homework assigned each week. You will accumulate one "exploration point" for each week that you attend the lecture and do the homework. At the end of the quarter, your total exploration points will be divided by 3 and will be added to your homework points. There will be 170 homework points total, so this isn't adding a lot to your potential score. As an example, if you were to participate in 3 exploration sessions, you would have 1 point added to your homework points, which is like getting one more point on a weekly programming assignment. The idea is to give people a small reward, but not something that is so large that people feel obligated to participate in these optional sessions.
There will not be an Exporation Section this week.
This week we will be talking about machine learning. In particular we will learn about two very interesting ideas, decision trees and neural networks. These techniques can be used to learn very complicated functions on a vast number of kinds of data
Files: Homework: (due by Friday, 6/3 3 pm via the link above)For your assignment this week, do the following. If a perceptron takes two boolean values inputs x and y, what weights and threshold must the perceptron use to achieve an output that is consistent with the NAND function. Let w1 be the weight associated with x, w2 be the weight associated with y and b be the threshold of the perceptron. The NAND function is the negation of the AND function and has the following truth table:
True | False | |
True | False | True |
False | True | True |
This week we will be talking about objects and inheritance in Python.
Files: Homework: (due by Tuesday, 5/24 3 pm via the link above)
For your assignment this week, create a Python class called Point3d
that extends the above Point class and that contains the following functions:
__init__(self, x, y, z)
- a constructor for Point3d that distance(p1, p2)
- takes two Point3d objects as parameters and returns the distance between them (notice that there is no self parameter, what does that mean).distanceFromOrigin(self)
- returns the distance between this Point3d and the origin (notice the self parameter, what does that mean).__add__(self, other)
- takes another Point3d as a parameter and returns a new Point3d whose components are the sums of the components of this Point3d and other.__str__(self)
- returns a string representation of this Point3d of the form "(x,y,z)".origin
- the 3 dimensional origin.There will not be an Exporation Section this week due to the midterm.
This week we will be talking about functional programming in the context of Python. Functional programming is a powerful flavor of programming that is drastically different from the iterative approach we are used to in Java.
Files: Homework: (due by Tuesday, 5/10 3 pm via the link above)
For your assignment this week, create a Python file called badgerfunctions.py
that contains the following functions:
badger1(n)
- returns a string that is "Badger" n times. Write this function in the usual way with the def
keyword (think about string multiplication).badger2(n)
- returns a string that is "Badger" n times. Write this function without using the def
keyword (think lambda functions).badger3(n)
- returns a string that is "Badger" n times. Write this function without using the def
keyword or lambda functions (think about partials).This week will get a whirlwind tour of the basics of Python, a popular scripting language. In many ways Python is simpler to write
Files: More information:
For your assignment this week, create a Python file called sortedlistmethods.py
that contains the following methods. Define the following operations on your list:
size(list)
- returns the number of elements stored in the listmax(list)
- return the maximum element from the list; if list is empty, raises an exceptionmin(list)
- return the minimum element from the list; if list is empty, raises an exceptionremove(list, index)
- removes the value at the given index; if index is not valid, raises an exceptionindexOf(list, value)
- searches the list for a value using binary search. Returns an index of the value if the value is in the list, or -1 if it is not.
contains(list, value)
- searches the list for a value using binary search. Returns True if the value is in the list, False if it is not.
add(list, value)
- adds given value in sorted orderremoveDuplicates(list)
- removes all duplicate values from a list so that the resulting list has only unique values. For example, for list = [1,1,2,2,2,3,4,4]
, a call removeDuplicates(list)
will result in list storing [1,2,3,4]
To throw ("raise") an exception in Python, write the following:
raise Exception("your error message here")
The list methods discussed in the documentation may be useful for deleting values (del) and working with lists. Also check out bisect.
Feel free to look back at your SortedIntList.java
for the algorithms to do these operations. Next week, when we learn about classes, you will make a sortedlist
class using these methods as the basis.
To do a binary search in Python, use the bisect
, bisect_left
, or insort
functions. Documentation for these functions is at the link below. To use them, remember to write: from bisect import *
Since the provided testlistmethods.py
is not a very good or exhaustive test, you are encouraged to write your own testing code to make sure your list works. If you like, you can turn in your own testlistmethods.py
. You should make sure that your code works with our testlistmethods.py
though.
This week we will be thinking about the power of human computation. In what ways are humans computationally better or more efficient than computers. Can we leverage this fact toward any useful end? We will take a look at some of the ways that people are already doing this to improve accessibility and our ability to search.
More information: Files: Homework: (due by Tuesday, 4/26 3 pm via the link above)
Visit Google reCAPTCHA and complete a few of the reCPATCHA tests. Your should successfully complete 3 text CAPTCHAs and 2 audio CAPTCHAs and record your responses. You should turn in a file named lastname_firstname_eshw3.pdf
to the dropbox linked above.
This week we will be exploring searching. What exactly does Google do and why is it such a big deal? What problems can arise in this field? We will examine Google's PageRank algorithm and see how it helps refine the effectiveness of an Inverted Index. We will see that building an Inverted Index uses the same Collections ideas we have been discussing in class.
More information: Files: Homework: (due by Tuesday, 4/19 3 pm via the link above)Visit Google Insights and play with the tool. Record your answers in a file named Homework2.doc or Homework2.pdf and turn it in with the link above. Find a search term that satisfies each of the following conditions (you should have 6 separate search terms):
This week we will be talking about computer security. What does it mean for a computer to be "secure"? How are modern day computer's secured? We will be focusing on CritterMain as a small case Study. Are/were there vulnerabilities in CritterMain? We will be exploring the security of CritterMain while investigating the issues that come up with computer security in general and what do to solve these issues.
More information: Homework: (due by Tuesday, 4/12 3 pm via the link above)Install Firefox and the Piigeon plugin. Piigeon allows you to see whether login credentials for a given website are encrypted or not by simply hovering over the submit button. Snoop around the internet and find 2 websites that do not have encrypted login information and 4 websites that do encrypt the login information.
Record your answers in a file named Homework1.doc or Homework1.pdf and turn it in with the link above.