Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Reframing The Problem - TrueNorthPHP 2014

Reframing The Problem - TrueNorthPHP 2014

Daniel Cousineau

November 08, 2014
Tweet

More Decks by Daniel Cousineau

Other Decks in Technology

Transcript

  1. reframing
    the problem

    View full-size slide

  2. how to think
    like a
    computer
    scientist

    View full-size slide

  3. how to think

    View full-size slide

  4. please rate me on joind.in
    https://joind.in/12724

    View full-size slide

  5. how to think
    like a
    computer
    scientist

    View full-size slide

  6. to solve our problem, we must
    first invent the universe

    View full-size slide

  7. functional fixedness

    View full-size slide

  8. go rubber
    duck
    yourself

    View full-size slide

  9. 4 1 2
    6 3
    7 5 8

    View full-size slide

  10. 4 1 2
    6 3
    7 5 8
    1 2
    4 6 3
    7 5 8
    up

    View full-size slide

  11. 4 1 2
    6 3
    7 5 8
    1 2
    4 6 3
    7 5 8
    up
    1 2
    4 6 3
    7 5 8
    right

    View full-size slide

  12. 4 1 2
    6 3
    7 5 8
    1 2
    4 6 3
    7 5 8
    up
    1 2
    4 6 3
    7 5 8
    right
    4 1 2
    6 3
    7 5 8
    right

    View full-size slide

  13. A* ->
    queue = expand(initial)
    while queue is not empty:
    dequeue move from queue
    if move is solution:
    return move
    concat expand(move) to queue
    sort queue by heuristic

    View full-size slide

  14. expand(state) ->
    moves = []
    if left valid move:
    add state.move(left) to moves
    if right valid move:
    add state.move(left) to moves
    if up valid move:
    add state.move(left) to moves
    if down valid move:
    add state.move(left) to moves
    return moves

    View full-size slide

  15. 4 1 2
    6 3
    7 5 8

    View full-size slide

  16. 4 1 2
    6 3
    7 5 8
    4 2
    6 1 3
    7 5 8
    4 1 2
    6 3
    7 5 8
    4 1 2
    6 5 3
    7 8
    4 1 2
    6 3
    7 5 8

    View full-size slide

  17. heuristic(state) ->
    manhattan(state) + outofplace(state)

    View full-size slide

  18. so what did
    we learn?

    View full-size slide

  19. don’t fixate

    View full-size slide

  20. pull back,
    abstract

    View full-size slide

  21. write down
    everything you
    know

    View full-size slide

  22. if all else fails,
    google.

    View full-size slide

  23. please rate ALL talks
    https://joind.in/12724

    View full-size slide