HOMEWORK_1
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. Show that the solution of T(n) = T(n - 1) + n is O(n^2).
Answer:
2. Use a recursion tree to determine a good asymptotic upper bound on the recurrence T(n) =
3T(n/2) + n. Use the substitution method to
HOMEWORK_7
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. Professor Bacon claims that the algorithm for strongly connected components would be
simpler if it used the original (instead of the transpose) graph in the second depth-first search
and scanned the ve
HOMEWORK_3
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. A d-ary heap is like a binary heap, but (with one possible exception) non-leaf nodes have d
children instead of 2 children.
a. How would you represent a d-ary heap in an array?
Answer:
Consider an arra
HOMEWORK_8
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. Run Dijkstras algorithm on the weighted graph below, using vertex A as the source. Write
the vertices in the order which they are marked and compute all distances at each step.
Answer:
2. Suppose we ch
HOMEWORK_5
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. Consider a modification of the rod-cutting problem in which, in addition to a price pi for each
rod, each cut incurs a fixed cost of c. The revenue associated with a solution is now the sum of
the pric
HOMEWORK_5
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. Consider a modification of the rod-cutting problem in which, in addition to a price pi for each
rod, each cut incurs a fixed cost of c. The revenue associated with a solution is now the sum of
the pric
HOMEWORK_4
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. The birthday paradox asks how many people should be in a room so that the chances are better
than even that two of them will have the same birthday (month and day). Find the quite
unexpected answer to
HOMEWORK_8
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. Run Dijkstras algorithm on the weighted graph below, using vertex A as the source. Write the
vertices in the order which they are marked and compute all distances at each step.
Answer:
2. Suppose we ch
HOMEWORK_6
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. Consider the problem of making change for n cents using the fewest number of coins.
Assume that each coin's value is an integer.
a. Describe a greedy algorithm to make change consisting of quarters, di
HOMEWORK_7
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
Professor Bacon claims that the algorithm for strongly connected components would be
simpler if it used the original (instead of the transpose) graph in the second depth-first
search and scanned the verti
HOMEWORK_3
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. A d-ary heap is like a binary heap, but (with one possible exception) non-leaf nodes have d
children instead of 2 children.
a. How would you represent a d-ary heap in an array?
Answer:
Consider an arra
HOMEWORK_6
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. Consider the problem of making change for n cents using the fewest number of coins.
Assume that each coin's value is an integer.
a. Describe a greedy algorithm to make change consisting of quarters, di
HOMEWORK_1
YOUSUF SADIQ MOHAMMED
ymohamme@uncc.edu
1. We can express insertion sort as a recursive procedure as follows. In order to sort A[1.n], we
recursively sort A[1.n-1] and then insert A[n] into the sorted array A[1.n-1]. Write a recurrence
for the
Relational Algebra
In this assignment you will be writing relational algebra (not SQL) queries to select various sets of
data
The following queries are based on this schema.
The above schema describes a database for airline flight information. Each FLIGHT
6.17. Consider the AIRLINE relational database schema
shown in Figure 5.8, which was described in Exercise 5.12.
Specify the following queries in relational algebra:
a. For each flight, list the flight number, the departure
airport for the first leg of th
VLAN
1
VLAN Configuration
The network lab has two Catalyst 2950T24 switches, and one
Catalyst 2950G Switch
- References:
http:/www.cisco.com/en/US/products/hw/switches/ps4916/pro
ducts_configuration_guide_chapter09186a008017e532.html
Catalyst 2950T24 and
WORK IT OUT!
1.
For a motorist there are three ways going from City A to City C. By way of bridge the distance is 20
miles and toll is $0.75. A tunnel between the two cities is a distance of 10 miles and toll is $1.00 for the
vehicle and driver and $0.10
Aptitude Test (Example Only)
Non Verbal Reasoning Ability
Concerned with how well you can think and solve problems. A series of puzzles are given, each of which has a
piece missing. You must decide which piece of several given alternatives will complete e
1) A bag contains 90 tokens numbered serially from 0 to 89.
If N is the no. of ways of selecting 3 tokens without replacement such that the sum of
the no. on them is 90, then N is divisible by.
2)the of all possible selections which a student can make for
Constraint Satisfaction Problems
(Chapter 6)
What is search for?
Assumptions: single agent,
deterministic, fully observable,
discrete environment
Search for planning
The path to the goal is the
important thing
Paths have various costs, depths
Search
History of AI
Image source
What are some successes of AI today?
IBM Watson
http:/www-03.ibm.com/innovation/us/watson/
NY Times article
Trivia demo
IBM Watson wins on Jeopardy (February 2011)
Self-driving cars
Googles self-driving car passes 300,000 miles
CS440/ECE448: Artificial Intelligence
What is AI?
Some possible definitions from the textbook:
1. Thinking humanly
2. Acting humanly
3. Thinking rationally
4. Acting rationally
AI definition 1: Thinking humanly
Need to study the brain as an information
p
Rational Agents (Chapter 2)
Agents
An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that
environment through actuators
Example: Vacuum-Agent
Percepts:
Location and status,
e.g., [A,Dirty]
Actions:
Le
Machine learning
Image source: https:/www.coursera.org/course/ml
Machine learning
Definition
Getting a computer to do well on a task
without explicitly programming it
Improving performance on a task based on
experience
Learning for episodic tasks
We h
Uninformed search strategies
A search strategy is defined by picking the
order of node expansion
Uninformed search strategies use only the
information available in the problem definition
Breadth-first search
Depth-first search
Iterative deepening sea
Informed search strategies
Idea: give the algorithm hints about the
desirability of different states
Use an evaluation function to rank nodes and
select the most promising one for expansion
Greedy best-first search
A* search
Heuristic function
Heuris