two integers is another example of the divide and conquer strategyA divide and

Two integers is another example of the divide and

This preview shows page 20 - 32 out of 38 pages.

two integers is another example of the divide and conquer strategy.A divide and conquer problem solving strategy works by recursively breaking down a problem into two or more sub-problems of the same (or related) type, until these become simple enough to be solved directly. The solutions to the sub- problems are then combined to give a solution to the original problem.
Image of page 20
Job Assignment Problem Exhaustive Search
Image of page 21
Knapsack Problem Exhaustive Search
Image of page 22
Problem solving by exhaustive search Suppose we have a Boolean expression F(a, b, c) = ab`c` + abc` + ac` One way of finding all the tuples (a, b, c) that yield true is to try out all the possibilities for the Boolean variables a, b, c. This gives 2^3 possibilities.
Image of page 23
Problem solving by exhaustive search Suppose we have n variables then we get 2^n possibilities. This is an example of exhaustive search. Here the number of searches grows exponentially with n. Exhaustive search is also known as brute-force search.
Image of page 24
Trial and Error Method
Image of page 25
Problem solving by trial and error Suppose we have to factor the polynomial x^2 + 4x + 3. The original binomials must have looked like this: (x + m)(x + n), where m and n are integers.We need to figure out the values of m and n. The constant term of the original polynomial is 3, so we need m*n = 3.
Image of page 26
Problem solving by trial and error What integers multiply together to give 3? The only choices are 1 and 3, or perhaps -1 and -3. The coefficient of the x term in the original polynomial is 4, so we also need m + n = 4. Since 1 and 3 multiply to give 3 and add together to give 4, we have m = 1 and n = 3. Therefore, we can factor our original polynomial as (x + 1)(x + 3)
Image of page 27
Problem solving by trial and error If we let m = 3 and n = 1 we'll have the same factorization, except with the factors written in a different order. Either way is correct, The problem was solved by the problem solving strategy of trial and error. Trial and error can be used for solving puzzles such as Sudoku.
Image of page 28
Map Coloring Problem
Image of page 29
Image of page 30
Problem solving by backtracking Suppose we have to arrange 8 queens in a chess board such that no two queens attack each other.
Image of page 31
Image of page 32

You've reached the end of your free preview.

Want to read all 38 pages?

  • Fall '16
  • Jegan
  • Eight queens puzzle

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors