Unit 3 Lesson 17-18

Notes

problem: description of a task that may or may not be able to be solved through the use of an algorithm. An instance of a problem includes a specific input. One example of this type of problem is a sorting problem.

decision problem: problem with a binary answer (yes or no). An optimization problem is a problem with the objective of finding the BEST solution amongst many possibilities to solve a problem.

An algorithm’s efficiency is determine through formal or mathematical reasoning.

decidable problem: problems for which algorithms can be written to solve/produce a correct output for all possible inputs.

undecidable problem: problems for which no algorithms can be built that can provide a correct yes or no answer.

Hack 1

Decidable problems are those that can be solved through the use of an algorithm. An example is determining whether a number is even or odd. Undecidable problems cant be solved with an algorithmic procedure. An example is the halting problem which asks if the program will run forever or halt.

Hack 2

Which of the following is a 3 step algorithm?

A. 2 x 6 x 8

B. 4^5

C. (3 x 8)^2

D. None of the above

E. All of the above

C is the correct answer sicne you have to multiplky the numbers inside of the parantheses then take that value to the power of two

Hack 3 and 4

Using the data.sort function I was able to rewrite the code more efficiently

Hack 5

By importing permutastions from the itertools I was able to rewrite the code more efficiently

Reflection

These hacks were a bit challenging at first but with perserverance I was able to understand the concepts which allowed me to perform the hacks well. The presentation was great and I learned a lot from it.