Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now

Computer Science Department – Rutgers University Quarantine 2020 CS 205: Homework Set 5

Computer Science Department – Rutgers University                                                                                                                                                    Quarantine 2020

 CS 205: Homework Set 5                                                                             16:198:205

Complete each of the following problems to the best of your ability. Remember, you can’t be graded on what you don’t write down so (unless you are just making stuff up) something is better than nothing. Discussing problems between each other is fine, but your final writeup and work must be your own.

 Big O and Asymptotic Behavior

1)   Argue that n! dominates any polynomial function of n, i.e., nα = O(n!) for any real α.

2)   Argue that n! dominates any exponential function of n, i.e., αn = O(n!) for any real α > 0.

3)   Argue that n! nn for n 1.

4)   Argue that n! (n/2)(n/2) for n 2.

5)   Argue, therefore, that ln(n!) = Θ(n ln n).

   Algorithms and Sorting

Suppose you are given a sequence or array of n real numbers (a1, a2, . . . , an), all distinct. We are interested in sorting this list, and ideally sorting it as efficiently as possible / with minimal effort.

All information relevant  to sorting a list can be thought of as contained in the order permutation.   If a list        (a1, a2, a3) has an ordering permutation of (3, 1, 2), that would mean a3 a1 a2, hence, the sorted form of the list would be (a3, a1, a2). This permutation encodes how all the elements compare to one another.

1)   How many possible ways could a list of n values be ordered, i.e., how many ordering permutations are there?

2)   Argue that if you know a list’s order permutation, sorting is easy (linear time), and conversely, if you know the steps to sort the list, you can easily generate the order permutation.

3)   Given this, argue that sorting can’t be easier than finding the order permutation.

4)   If every element comparison (testing where ai aj) provides at most one bit of information, argue that in order to be able to sort any list, you need to perform at least approximately log2(n!) many comparisons.

5)   Based on the prior result, argue that merge sort is, asymptotically, as or more efficient than any other sorting algorithm.

 Bonus) What are the tightest (simple) bounds you can achieve and verify on ln(n!)?

 

 

1

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

Native UK, USA & Australia writers Deadline from 3 hours 100% Plagiarism-Free — Turnitin included Unlimited free revisions Free to submit — compare quotes
Scroll to Top