Algorithm Correctness
Algorithm Correctness
Algorithm: A finite series of steps to solve a problem that always works
Proof Of Correctness: Verification of an algorithms ability to solve a problem
Necessity of Proofs:
1. Especially useful for non-obvious a
Matrix Multiplication
The Computation for Each Cij
Divide and Conquer Solution
Complexity of Divide and Conquer
Strassens Matrix Multiplication
A * B = C, where A, B, and C are compatible Matrices for multiplication
A11
A21
A12 B11 B12
=
A22 B21 B22
Mathematical Tools
Mathematical Tools
x
Floor of x:
x
Ceiling of x: smallest integer greater than or equal to x
largest integer less than or equal to x
2.99 2
2.01 2
2 2
2.99 3
2.01 3
5 5
1
Mathematical Tools
Logarithms:
3.5
y = ln(x)
3
f(x)
2.5
y = ln(x)
Homework 3 Solutions
Q1. List the following functions in Big O and graphically represent the growth of each function.
f1(n) = 9n2-n+3
f2(n) = 2lgn + 3
f4(n) = 3n + 4
f5(n) = lg(n2)+7n
Also show the order of functions with the graph
Ans : Order is as follo
B-Tree A Search Tree of order m. The order can be
as small as 3 or very large, such as 256 or 512.
B-Tree Invariant
1. Root is either an external node (empty tree) or it has between
2 and m children.
2. All non-root internal nodes have between
m
2
and m
HOMEWORK 2
Q1. List the functions below from the lowest to the highest order. If any two or more are of the same
order, indicate which.
Ans: (1/3)n , 6, (3/2)n , log log n , log n , (logn)2, ln n, n1/3 + logn, , n/logn , n , nlogn , n2 , n2 + logn ,
, n3
Homework 1
Q1. Prove by induction: n3-n is divisible by 6 for all positive integers.
Proof: Base case- n=2
Substitute in n3-n = 8-2=6/6=1 which is true
Induction Hypothesis: put n=k in above, then
K3-k = 6m for all positive integers k
Induction step:
Assu
Homework 4
Q1. Solve for the Time complexity using Masters Theorem.
(4) + 3 Not applicable because number of branches are not constant
2
2
() = 7(3) +
( ) Case 3
3
) Case 1
() = 3(2) + (
2
() = 3(3) + ( ) Case 2
a. () = 5
b.
c.
d.
n
2
Show three levels
HOMEWORK 2
Q1. List the functions below from the lowest to the highest order. If any two or more are of the same
order, indicate which.
Q2. Write an algorithm to find the summation of even numbers in an array of n elements. Find the best,
worst and averag
Homework 4
Q1. Solve for the Time complexity using Masters Theorem.
(4) + 3
2
() = 7(3) +
() = 3(2) +
() = 3(3) +
a. () = 5
b.
c.
d.
n
2
Q2. Let us suppose an algorithm has a complexity, T(n) = 4T +nlgn, draw a recurrence tree
diagram. Show three lev
HOMEWORK 3
Q1. List the following functions in Big O and graphically represent the growth of each function.
f1(n) = 9n2-n+3
f2(n) = 2lgn + 3
f4(n) = 3n + 4
f5(n) = lg(n2)+7n
f3(n) = 4nlgn
Q2. Find the specific solution and cross check your answer.
-7an-1
ANALYSIS OF ALGORITHMS
CPSC-502-11
ASSIGNMENT ONE
Name: Tanveen Kaur
ID: 1014603
Date: 1/27/2017
Question 1: Prove by induction: n3-n is divisible by 6 for all positive integers.
Solution:
Proof:
i)
Basis: For n = 1, we have:
13 1 = 0, which is divisible
Amity Institute of Psychology and Allied
Sciences
Btech Semester 5
Behavioral Science
1
Group Dynamics & Team Building
CONTENTS
Workshop 1 : Group Formation
Workshop 2: Group Functions
Workshop 3: Teams
Workshop 4: Leadership
Workshop 5: Power to Empower
Dr Sandeep Srivastava
Assistant Professor
AINT, Amity University
Webpage:
www.amity.edu/aint/faculty.asp
https:/sites.google.com/site/iitgsandy/ho
me
[email protected][email protected]
anomagnetic Materials & Application
Objectives: To enable st
Abstract
Interdiegtated Electr0des has been able t0 bec0me t5he m0re senstieve
electr0chemiecal sens0rs. It had tw0 vry thien iendievdual c0mblieke electr0de
structur whiech made an arrangement that caused it p0ssieble to c0btr0l
senstieviety. Here we try
Kindly fill the Information accurately; please make sure you use Upper and Lower case letters.
Dates need to be mentioned in MM/DD/YYYY format.
Personal Information
First (given) Name
Middle Name
Last (family) Name
Former Name (if applicable)
Email Addres
Olefin Metathesis Polymerization
Olefin metathesis reactions are metal-mediated carboncarbon (CC) double bond
exchange processes,1,2 which were discovered in the mid 1950s. Chauvin proposed the
commonly accepted mechanism for metathesis involving a metall
Report for Lab 1-1: Testing Wireshark
Name:Tanmay Tiwari
Student ID: 1007345
Date: 09/28/2016
Part I
1
Is the frame an outgoing or an incoming frame?
The frame is an incoming frame as we are at the end where the frames are coming towards us.
2
Source IP a
Creating a product catalog with djondb
Bala Siddartha Varma Chinda, Bhargav Reddy Meyreddy
Department of Computer Science
University of Bridgeport, Bridgeport, CT
Abstract
DjonDB is a document based database whose query language is similar to
SQL which m
Movie data analysis and deriving the best genre films based on ratings
Bala Siddartha Varma Chinda
Department of Computer Science,
University of Bridgeport, Bridgeport, CT
Introduction
Movies are the basic source of entertainment. If taken as an entity, t