# Creative Reductions ## ...and Wrap Up --- CS 137 // 2021-12-08 ## Administrivia - Assignment 2 is returned on Gradescope - Assignment 3 due today # Final Exam - Tuesday, December 14th - 2:00 PM to 3:50 PM - Collier-Scripps 301 ## Final Exam - **Format of the exam**: + Written, in-class, 110-minute exam + Closed textbook/notes/internet - Exam will be cumulative and cover materials from the entire semester ## Final Exam "Cheatsheet" - You may bring a one 8.5x11 sheet of paper with you to the final exam - This sheet may have notes on both sides as long as: + All notes are **handwritten** by **YOU** - My hope is that thinking through what to include on the sheet and preparing it will be an effective study mechanism # Questions ## ...about anything? # Reductions ## Reductions - A problem $A$ is reducible to a problem $B$ if: + An instance of $A$ can be converted to an equivalent instance of $B$ + Thus, if $B$ is solvable, then so is $A$ ## Reductions - **Fact:** If $A$ is an $NP$-hard problem and $A$ is polynomially reducible to $B$, then $B$ is also $NP$-hard - To prove a problem is $NP$-hard, we just need to reduce a well-known $NP$-hard problem to it ![NP reduction diagram](../../assets/images/np-reduction-diagram.png) ## Creative Reductions - [Classic Nintendo Games are NP Hard](https://arxiv.org/pdf/1203.1895.pdf) + [Video Explanation](https://www.youtube.com/watch?v=oS8m9fSk-Wk) # Reflections ## Overall Theme of the Course - Identifying and solving problems **efficiently** + Understand and apply various data structures and algorithm design techniques + Be able to analyze the accuracy and efficiency of algorithms and compare approaches - Recognizing **hard** problems and where that hardness comes from ## Data Structures - Sequential + Array list, linked list, array deque, etc. - Hierarchical + Trees, binary search trees, heaps, etc. - Dictionaries (maps) + Hashtables - Relational + Graphs ## Techniques - Greedy - Divide and conquer - Dynamic programming - Reductions ## Algorithms - Sorting + Heapsort, merge sort, quick sort - Graphs + DFS, BFS, topological sort, Prim's, Kruskal's, Dijkstra's - Dynamic programming + Fibonacci, word segmentation, edit distance, seam carving # Evaluations - [Click Here for Evaluation](http://drake.qualtrics.com/jfe/form/SV_brQ0Lfq6EixLEto) # Practice Problems ## Practice Problems - Asymptotic notation (Skiena 2-11, 2-23) - Writing an algorithm (Skiena 3-18, 4-49, 5-5) - Data structure design (Skiena 3-20) - Data structure comparison (Skiena 4-19) - Graphs (Skiena 7-1, 7-2)