CCM Programming Challenge Crypto: Heuristic Document

Document representing the heuristics that are incorporated into the heuristic problem solver. The representation of each heuristic consists of name composed of a relatively small number of words, an English description, a pseudocode description, and three examples of its application.

Heuristic 1

  1. Name - Zeros
  2. English - If the goal is zero and zero is among the numbers, then multiply all of the numbers together.
  3. Pseudocode - if ((the goal is zero) and (zero is among the numbers)) then [multiply the numbers together]
  4. Examples
  1. numbers = {5,4,0,8,9} goal = 0 solution = (5*(4*(0*(8*9))))
  2. numbers = {0,5,3,5,8} goal = 0 solution = (0*(5*(3*(5*8))))
  3. numbers = {7,6,7,1,0} goal = 0 solution = (7*(6*(7*(1*0))))

Heuristic 2

  1. Name - Number Pair and Zero Goal
  2. English - If the goal is zero and there is a pair among the numbers, then multiply the difference between the pair of numbers by the product of the remaining numbers.
  3. Pseudocode - if ((the goal is zero) and (there is a pair among the numbers)) then [multiply the difference between the pair of numbers by the product of the remaining numbers]
  4. Examples
  1. numbers = {4,5,6,4,9} goal = 0 solution = ((4-4)*(5*(6*7)))
  2. numbers = {5,0,6,0,7} goal = 0 solution = ((0-0)*(5*(6*7)))
  3. numbers = {1,0,1,2,3} goal = 0 solution = ((1-1)*(0*(2*3)))

Heuristic 3

  1. Name - Nonzero Goal and Zero Number
  2. English - If the goal is nonzero and the goal is among the numbers and zero is among the numbers, then add the goal to the product of the remaining numbers.
  3. Pseudocode - if ((the goal is nonzero) and (the goal is among the numbers) and (zero is among the numbers)) then [add the goal to the product of the remaining numbers]
  4. Examples
  1. numbers = {7,0,9,2,6} goal = 9 solution = (9+(7*(0*(2*6))))
  2. numbers = {5,4,3,1,0} goal = 4 solution = (4+(5*(3*(1*0))))
  3. numbers = {0,2,3,5,3} goal = 3 solution = (3+(0*(2*(3*5))))

Heuristic 4

  1. Name - Pair Add to Goal and Zero Number
  2. English - If a pair add to the goal and there is a zero in the rest of the numbers, then add the sum of the pair to the product of the remaining numbers.
  3. Pseudocode - if ((a pair add to the goal) and (there is a zero in the rest of the numbers)) then [add the sum of the pair to the product of the remaining numbers]
  4. Examples
  1. numbers = {1,2,0,4,5} goal = 3 solution = ((1+2)+(0*(4*5)))
  2. numbers = {2,3,0,5,6} goal = 5 solution = ((2+3)+(0*(5*6)))
  3. numbers = {3,4,0,6,7} goal = 7 solution = ((3+4)+(0*(6*7)))

Heuristic 5

  1. Name - Pair Subtract to Goal and Zero Number
  2. English - If a pair subtract to the goal and there is a zero in the rest of the numbers, then add the difference that equals the goal of the pair to the product of the remaining numbers.
  3. Pseudocode - if ((a pair subtract to the goal) and (there is a zero in the rest of the numbers)) then [add the difference that equals the goal of the pair to the product of the remaining numbers]
  4. Examples
  1. numbers = {1,2,0,4,5} goal = 3 solution = ((4+1)+(2*(0*5)))
  2. numbers = {2,3,0,5,6} goal = 4 solution = ((6+2)+(3*(0*5)))
  3. numbers = {3,4,0,6,7} goal = 1 solution = ((4+3)+(0*(6*7)))

Heuristic 6

  1. Name - Pair Add to Goal and Pair In Rest
  2. English - If a pair add to the goal and there is a pair in the rest of the numbers, then add the sum of the pair that equals the goal to the product of the difference of the pair that equals zero multiplied by the other number.
  3. Pseudocode - if ((a pair add to the goal) and (there is a pair in the rest of the numbers)) then [add the sum of the pair that equals the goal to the product of the difference of the pair that equals zero multiplied by the other number]
  4. Examples
  1. numbers = {5,3,4,2,3} and goal = 6 solution = ((4+2)+((3-3)*5))
  2. numbers = {9,9,2,8,2} and goal = 4 solution = ((2+2)+((9-9)*8))
  3. numbers = {0,1,5,6,6} and goal = 1 solution = ((0+1)+((6-6)*5))

Heuristic 7

  1. Name - Pair Subtract to Goal and Pair In Rest
  2. English - If a pair subtract to the goal and there is a pair in the rest of the numbers, then add the difference of the pair that equals the goal to the product of the difference of the pair that equals zero multiplied by the other number.
  3. Pseudocode - if ((a pair subtract to the goal) and (there is a pair in the rest of the numbers)) then [add the difference of the pair that equals the goal to the product of the difference of the pair that equals zero multiplied by the other number]
  4. Examples
  1. numbers = {6,4,9,9,5} and goal = 1 solution = ((6-5)+((9-9)*4))
  2. numbers = {5,1,4,1,6} and goal = 1 solution = ((5-4)+((1-1)*6))
  3. numbers = {4,4,1,4,8} and goal = 7 solution = ((8-1)+((4-4)*4))

Heuristic 8

  1. Name - Goal In Numbers and Pair In Rest
  2. English - If the goal is in the numbers and there is a pair in the rest of the numbers, then add the goal to the product of multiplying the difference of the pair with the rest of the numbers.
  3. Pseudocode - if ((the goal is in the numbers) and (there is a pair in the rest of the numbers)) then [add the goal to the product of multiplying the difference of the pair with the rest of the numbers]
  4. Examples
  1. numbers = {8,2,7,6,6} and goal = 8 solution = (8+((6-6)*(2*7)))
  2. numbers = {9,0,5,0,9} and goal = 9 solution = (9+((0-0)*(5*9)))
  3. numbers = {5,2,7,4,5} and goal = 2 solution = (2+((5-5)*(7*4)))