Is3350 Unit 1 Assignment

1638 Words4 Pages

School of Engineering and Information Technology ASSESSMENT COVER SHEET
Student Name PRATAP ADHIKARI
Student ID S268073
Assessment Title Assignment 2
Unit Number and Title HIT 400 Discrete Structures
Lecturer/Tutor Dr. PETER SHAW
Date Submitted 13/10/2014
Date Received
Office use onl
KEEP A COPY
Please be sure to make a copy of your work. If you have submitted assessment work electronically make sure you have a backup copy.
PLAGIARISM
Plagiarism is the presentation of the work of another without acknowledgement. Students may use a limited amount of information and ideas expressed by others but this use must be identified by appropriate referencing.
CONSEQUENCES OF PLAGIARISM
Plagiarism is misconduct as defined …show more content…

To solve the recurrence relation, we need to find the quadratic function that is suitable. The n values are input to the function (the ‘x’ values) and the T(n) values are output to the function (the ‘y’ values). From above, we have six set of points(1,1),(2,8),(3,19),(4,34),(5,53) and (6,76).
The standard format of the quadratic equation is ax2+bx+c=y
One method of solving recurrence relation with constant second differences is to write a number of equations and solve it for a,b,c.
We choose three points from the recursive sequence to write a number of three equations.
Using point(1,1) ax2+bx+c=y substitute 1 in for x and 1 in for y We get, a*12+b*1+c=1 a+b+c=1………………eqn(1)
Using point(2,8) ax2+bx+c=y substitute 2 in for x and 8 in for y We get, a*22+b*2+c=8 4a+2b+c=8………………eqn(2) Using point (3,19), ax2+bx+c=y substitute 3 in for x and 19 in for y We get, a*32+b*3+c=19 9a+3b+c=19………………eqn(3)

Solve the system of equations
Subtract equation 1 from equation 2 leaving combined eqn 1.
4a+ 2b +c …show more content…

.

For all n we have
T1(k) = T0(k-1) + (d-2){T0(k-2) +(d-2){ T0(k-3) +(d-2)T1(k-n)}}
Let k=n
T1(n) = T0(n-1) + (d-2){T0(n-2) +(d-2){ T0(n-3) +(d-2)T1(n-n)}}
T1(n) = T0(n-1) + (d-2){T0(n-2) +(d-2){ T0(n-3) +(d-2)T1(0)}}
Assume T1(0)=0
T1(n) = T0(n-1) + (d-2){T0(n-2) +(d-2){ T0(n-3) +(d-2)0}}
T1(n) = T0(n-1) + (d-2){T0(n-2) +(d-2)T0(n-3) }
T1(n) = T0(n-1) + (d-2){T0(n-2) +(d-2){ T0(n-3) }
T1(n) = T0(n-1) + (d-2) T0(n-2) +(d-2) (d-2) T0(n-3)
Since (d-2) is a constant (c), Hence the general form would be
T1(n) = c0*T0(n-1) + c1* T0(n-2) +c2*T0(n-3) +………………………
Hence, the recurrence relation is solved
Question 3 (25 Marks)
Draw a DFA diagram that represents a standard Drink machine accepting money
ANS: The following Deterministic Finite Automata (DFA) diagram represents a standard Drink machine which dispenses only one kind of soft drink at the price of $0.30. It accepts only nickels, dimes and quarters and automatically returns change for any amount deposited over $0.30 per drink. The machine has 2 buttons-one for dispensing a drink; the other to return the deposited

More about Is3350 Unit 1 Assignment

Open Document