COMP 102: Homework 1
Assigned Sept 9, 2010
Due in class Sept 16, 2010
50 points total
1
Technical Exercises
For each problem, show all your work (required for credit). For answers requiring written answers,
while no more than ve or six sentences are expec
COMP 102: Computers and Computing
Lecture 9: Sorting
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
On the usefulness of sorting
Recall our example last week about finding the minimum.
At the end of
COMP 102: Computers and Computing
Lecture 2: Bits&bytes, Switches, and Boolean Logic
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
The Lowly Bit
What is the smallest unit of information?
Chemistry h
COMP 102: Computers and Computing
Lecture 6: Introduction to Scripting
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Programming basics
Difference between a programming language and a program.
Under
COMP 102: Computers and Computing
Lecture 7: Machine Language
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Quick Recap
Weeks 1-2: Hardware approach
Every problem is expressed with boolean variable
COMP 102: Computers and Computing
Lecture 4: Finite State Machines and Memory
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
What have we seen so far?
Representing many types of data (text, numbers,
Assignment 3
Marion Luiz
260463573
March 23/2012
1
a) Copy both, sorted array L and sorted array P into an auxiliary array Q
Select the first variable from the sorted array L and compare it with the first variable in array P
Place the smaller variable int
COMP 102: Assignment 4
Available: Thursday April 12th, 2012
Due Date: Monday April 23rd, 2012, before midnight
Notes: Use the assignment handin option in webct to turn in your solution to this
assignment. It is critical that what you submit reects your ow
Assignment 4
Marion Luiz
260463573
April 13/2012
Graphics
The two basic approaches for drawing 3D geometry on a 2D computer screen
are forward object order and backward image order. Forward object order is
implemented by changing geometry into points, lin
Computer graphics and animation
Graphics has been a key to technology growth
Hardware revolution drives everything
Graphics processing unit (GPU) NVIDIA GTX680 (3.5 billion transistors, 153 shaders)
Geometry
Can represent things as parametric or explicit
A game of cat and mouse
Marion Luiz
260463573
1. I imported a cat sprite as well as a mouse sprite from the costume section of
choose new sprite from file. After doing so I shrunk both sprites with the shrink
option on scratch.
2. For this block of code I
Assignment 4
Marion Luiz
260463573
April 13/2012
Graphics
The two basic approaches for drawing 3D geometry on a 2D computer screen are forward object
order and backward image order. Forward object order is implemented by changing geometry into
points, lin
Comp 102:Assignment 1
Marion Luiz
260463573
29/01/12
1)
1. 68 in base 2= 1000100
123 in base 2= 1111011
31 in base 2= 11111
2. 10111100 in base 10= 188
0110101 in base 10= 53
1000101 in base 10= 69
3. The largest number you can represent with 4 bytes is
=
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project source="2.7.1" version="1.0">
This file is intended to be loaded by Logisim (http:/www.cburch.com/logisim/).
<lib desc="#Wiring" name="0"/>
<lib desc="#Gates" name="1"/>
<lib desc="#Plexers"
Computers and Computing (COMP-102)
Syllabus - Winter 2015
General Information
Location:
Times:
Instructor:
Teaching
assistants:
Class web page:
Trottier 0100
Monday and Wednesday, 14:35am-15:55am.
Professor Kaleem Siddiqi, School of Computer Science
Email
COMP 102: Computers and Computing
Lecture 3: Truth Tables and Logic Gates
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Practice example
Three friends are trying to decide what to do Saturday night
COMP 102: Computers and Computing
Lecture 5: What is Programming?
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Motivation
The advantage of a computer it its ability to solve almost any problem.
BUT
COMP 102: Computers and Computing
Lecture 8: Of Arrays and Algorithms
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Quick recap of loops and variables
Example: Calculate the sum of (integer) numbers
COMP 102: Homework 2
Assigned Sept 16, 2010
Due in class Sept 23, 2010
50 points total
1
Technical Exercises
For each problem, show all your work (required for credit). For answers requiring written answers,
while no more than ve or six sentences are expe
COMP 102: Homework 3
Assigned Sept 24, 2010
End of day, Oct 1, 2010
50 points total
1
Technical Exercises
For each problem, show all your work (required for credit). For answers requiring written answers,
while no more than ve or six sentences are expecte
COMP 102: Homework 4
Assigned Oct 5, 2010
In class, Oct 14, 2010
50 points total
1
Technical Exercises
For each problem, show all your work (required for credit). For answers requiring written answers,
while no more than ve or six sentences are expected,
Jessica Hodhod
Homework # 5
1.1 Password Hacking
1. Brute-forcing a password simply means that one is systematically trying to determine someones
password using all possible combinations of characters. If we know that the password is either 5, 6
or 7 char
COMP 102: Computers and Computing
Lecture 17: Computability
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Paris, 1900
On 8 August 1900, at the Paris
2nd International Congress of
Mathematicians, at
COMP 102: Computers and Computing
Lecture 19: Constraint Satisfaction Problems
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Overview
What is a Constraint Satisfaction Problem (CSP)?
Common examples
COMP 102: Computers and Computing
Lecture 1: Introduction
!
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Outline for today
What are computers? What is computing?
What will this course contain?
I
COMP 102: Computers and Computing
Lecture 17: Computability
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Paris, 1900
On 8 August 1900, at the Paris
2nd International Congress of
Mathematicians, at
COMP 102: Computers and Computing
Lecture 23: Computer Vision
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
What is computer vision?
Broadly speaking, it has to do with making a computer see.
The co
COMP 102: Computers and Computing
Lecture 16: Multi-media data representation
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Quick recap of data compression
Previous class: Basic ideas in data compre
COMP 102: Excursions in Computer Science
Lecture 12: Graphs
Instructor: Svetlana Stolpner (sveta@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
The 7 Bridges of Knigsberg
In the former city of Knigsberg, East Prussia, the river Pregel
COMP 102: Computers and Computing
Lecture 12: Graphs
!
Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca)
Class web page: www.cim.mcgill.ca/~siddiqi/102.html
Quick Review of Graphs
A graph is a pair (N, E), where
N is a set of nodes.
E is a collection