COMP 200 & COMP 130
Assignment 1: Computational Thinking & Introductory Python
Be sure to read the course policies, as posted on the course web site:
http:/www.clear.rice.edu/comp200/policies.shtml.
Work individually on this assignment. Turn in two les: A
Text Searching, Analysis, & Generation
COMP 200 & COMP 130
Do Two Texts Share Authors?
How can we approach problem?
Some Possible Analyses
Handwriting
Chemical
Historical
Literary
Linguistic - stylometry
Problem Decomposition 1st Stage
Python data
Fi
Overgrazing
Wild Approximations
Use Python Conditional
if condition:
statements
if condition:
statements
elif condition:
statements
else:
statements
if condition:
statements
else:
statements
Overgrazing
How to model population effects?
If prey population
The hare birth rate is constant, as their food supply is
unlimited. Hares only die when eaten by a lynx, and the
number of hares eaten is proportional to how often hares
& lynxes meet, i.e., the chance of a lynx catching a hare.
The lynx birth rate is als
Predicting predator-prey populations
Desired results
Heres an approximation of reality:
The hare birth rate is constant, as their food supply is
unlimited. Hares only die when eaten by a lynx, and the
number of hares eaten is proportional to how often har
# A PQ is a dictionary mapping nodes to distances.
PQ1 = cfw_
def addNode1(node,distance):
"Add node to the PQ with the given distance if the node isn't already
present. Updates the node's distance if it is present."
if node in PQ1:
# Possibly update the
COMP 200 Elements of Computer Science
COMP 130 Elements of Algorithms & Computation
John Greiner
Stephen Wong
Our Goals for You
Become a better problem solver.
Solve problems using Python programming.
Have a broad understanding of what computer
science
Graphs Searching for
Relationships
COMP 200 & COMP 130
John Greiner & Stephen Wong
Graphs A Reminder
Vertices/nodes + edges connecting vertices
1
2
1
2
5
3
4
Directed
5
3
4
Undirected
Social graph
How are you
connected to
someone else?
Math co-authors, ce
COMP 200 & COMP 130
Assignment 6: Shortest Paths, Probabilistic Reasoning
Be sure to read the course policies, as posted on the course web site:
http:/www.clear.rice.edu/comp200/policies.shtml
Work in assigned pairs on this assignment. Each pair should pu
COMP 200 & COMP 130
Assignment 5: Recursion, Graph Searching
Be sure to read the course policies, as posted on the course web site:
http:/www.clear.rice.edu/comp200/policies.shtml
Work in assigned pairs on this assignment. Each pair should put all assignm
COMP 200 & COMP 130
Assignment 4: Data Structures, Markov Chains, PCA
Be sure to read the course policies, as posted on the course web site:
http:/www.clear.rice.edu/comp200/policies.shtml
Work in assigned pairs on this assignment. Each pair should put al
COMP 200 & COMP 130
Assignment 3: Regular Expressions, Dictionaries, Text Analysis,
Edit Distance
Be sure to read the course policies, as posted on the course web site:
http:/www.clear.rice.edu/comp200/policies.shtml
Work in assigned pairs on this assignm
COMP 200 & COMP 130
Assignment 2: Control Flow & Predator-Prey
Be sure to read the course policies, as posted on the course web site:
http:/www.clear.rice.edu/comp200/policies.shtml.
Work individually on this assignment. Turn in two les: A Python le, neti
Who was Mark V. Shaney?
COMP 200 & COMP 130
Mark was a member of a UseNet News group called
net.singles, a users group chock full of dating tips,
lonely heart chatter, frank discussions of sexual
problems and high tech missionary gospel about the
sins of