CS556_Homework5

doc

School

Carnegie Mellon University *

*We aren’t endorsed by this school

Course

703

Subject

Computer Science

Date

Dec 6, 2023

Type

doc

Pages

2

Uploaded by ColonelStar3923

Report
CS556 Homework 5 Due – Dec 6, 6:00 PM, at the class beginning Student’s Name: _____________________________________ All work must be your own. Upload copy of your homework and any supporting materials (source code and test cases) online to Assignment5 in the CS566_A2 course site No extensions or late submissions for anything other than major emergency. Show your work in detail. Q1 [25 pts.]: Evaluate performance characteristics of two string matching algorithms (Brutal Force algorithm and Knuth-Morris-Pratt algorithm) for the following case: PATTERN: agtacg STRING: gcagtacgcagagagtatacagtacg Compare performance of these two algorithms in terms of Preprocessing time and Matching time. Q2 [30 pts.]: Design AND implement (i.e., write a program) an algorithm based on text matching that adds two polynomials such as (x**3 + 5x**2 -3x + 3) + (4x**5 - 2x**2 + 1) Place the theta value of your algorithm as the first comment in the code. Submit several challenging test cases. Hint: Input consist of a text string: “polynomial#1, sign of arithmetic operation, and polynomial#2 ”, where polynomials consists of monomial like ‘Cx**n’, arithmetical operations ‘+/-‘ and parenthesis ’(‘,’)’. C and n are one-digit integers. You must parse the text first, identify all terms in both polynomials and output the resultant string. I recommend the “grep” like function for matching string and pattern. Q3 [25 pts]: What is your INFORMED opinion on the NP problems? Does a deterministic NP polynomial time algorithm exist or not? Your answer should be a well-thought out and informed argument consisting of couple paragraphs at least. No credit for poor grammar and simplistic answers. Your argument should be convincing and strong.
Q4 [20 pts] Give an example of non-linearities in neural networks used for machine learning. Why is it necessary to have it in networks?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help