When%20you%20add%20the%20age%20of%20the%20ship%20and%20the%20age%20of%20its%20boiler,%20it%20totals%2042%20years.%20So%20S%20 %20B%20=%2042.%20Now%20pay%20attention!%20The%20ship%20is%20twice%20as%20old%20as%20the%20boiler%20was%20when%20the%20ship%20was%20as%20old%20as%20the%20boiler%20is%20now. - PowerPoint PPT Presentation

About This Presentation
Title:

When%20you%20add%20the%20age%20of%20the%20ship%20and%20the%20age%20of%20its%20boiler,%20it%20totals%2042%20years.%20So%20S%20 %20B%20=%2042.%20Now%20pay%20attention!%20The%20ship%20is%20twice%20as%20old%20as%20the%20boiler%20was%20when%20the%20ship%20was%20as%20old%20as%20the%20boiler%20is%20now.

Description:

When you add the age of the ship and the age of its boiler, it totals 42 years. ... then the ship's age must be an even number. ... – PowerPoint PPT presentation

Number of Views:508
Avg rating:3.0/5.0
Slides: 13
Provided by: wei8
Learn more at: http://www.cs.unc.edu
Category:

less

Transcript and Presenter's Notes

Title: When%20you%20add%20the%20age%20of%20the%20ship%20and%20the%20age%20of%20its%20boiler,%20it%20totals%2042%20years.%20So%20S%20 %20B%20=%2042.%20Now%20pay%20attention!%20The%20ship%20is%20twice%20as%20old%20as%20the%20boiler%20was%20when%20the%20ship%20was%20as%20old%20as%20the%20boiler%20is%20now.


1
(No Transcript)
2
When you add the age of the ship and the age of
its boiler, it totals 42 years. So S B 42.
Now pay attention! The ship is twice as old as
the boiler was when the ship was as old as the
boiler is now. How old is the ship and how old is
the boiler?
3
There are a finite number of choices 042. And
since the ship is twice as old, then the
ships age must be an even number. So try them
all 0, 2, 4, 6, , 42 and see what works
Answer The ship is 24 the boiler is 18.
4
Mothers age is the sons age with digits
reversed (like 63 and 36). They notice that this
is the sixth time in their life that this has
happened. And if there are lucky, it will happen
two more times. How old are they?
5
Start with mother being 16 years older than son.
So we get (16,0), (17,01), (18,02), Then try
17 years, 18, years, etc.
For 18 years different, we get (20,02), (31,13),
(42,24), (53,35), (64,46), (75,57), (86,68),
(97,79)
6
Whats the point?
  • If the space of possible solutions is small
    enough, we can solve a problem by simply checking
    all possibilities.

7
Brute force!
8
What characterizes problems that can be solved
this way?
  • Oh yeah!
  • Finite superset.

9
Examples of problems
  • All permutations of 12345
  • Combination lock
  • 8 Queens
  • Word jumble
  • 9-Square puzzle
  • Maze running
  • Instant Insanity
  • ????? ????? stuff
  • and many more

10
Two important attributes
  • Oh yeah
  • Hard to solve, but given an alleged solution,
    its easy to see if it is right.
  • Finite superset
  • Can test exhaustively

11
Restriction
  • We will look at problems whose solution is a
    sequence
  • a1, a2, a3, an
  • Where n is known in advance (or at least
    bounded), and each ai is drawn from a finite
    pool. Hence finite superset.

12
So to solve by brute force
  • Systematically generate all elements of the
    superset.
  • Run each through a filter.

Solution
Superset generator
Filter
Not
Write a Comment
User Comments (0)
About PowerShow.com