..  Copyright (C)  Brad Miller, David Ranum, Jeffrey Elkner, Peter Wentworth, Allen B. Downey, Chris
    Meyers, and Dario Mitchell.  Permission is granted to copy, distribute
    and/or modify this document under the terms of the GNU Free Documentation
    License, Version 1.3 or any later version published by the Free Software
    Foundation; with Invariant Sections being Forward, Prefaces, and
    Contributor List, no Front-Cover Texts, and no Back-Cover Texts.  A copy of
    the license is included in the section entitled "GNU Free Documentation
    License".

.. qnum::
   :prefix: intro-2-
   :start: 1

Algorithms
----------

If problem solving is a central part of computer science, then the solutions that you create through
the problem solving process are also important.  In computer science, we refer to these solutions
as **algorithms**.  An algorithm is a step by step list of instructions that if followed exactly will solve the problem under consideration.

Our goal in computer science is to take a problem and develop an algorithm that can serve as a general solution.  Once we have such a solution, we can use our computer to automate the execution.  As noted
above, programming is a skill that allows a computer scientist to take an algorithm and represent it in
a notation (a program) that can be followed by a computer.  These programs are written in **programming languages**.

**Check your understanding**

.. mchoice:: question1_1_1
   :practice: T
   :answer_a: To think like a computer.
   :answer_b: To be able to write code really well.
   :answer_c: To be able to solve problems.
   :answer_d: To be really good at math.
   :correct: c
   :feedback_a: Computers do not think, they only do what we humans tell them to do via programs.
   :feedback_b: While it is necessary for most computer scientists to know how to write code, it is not the most important skill.
   :feedback_c: Computer scientists are all about solving problems.  We use computers to automate solutions to problems and to do things faster and more accurately than we can do by hand or manually.
   :feedback_d: Computer science and math are similar in many ways and it helps to have a strong mathematical foundation, but you do not have to be good at math to be a good computer scientist.

   What is the most important skill for a computer scientist?

.. mchoice:: question1_1_2
   :practice: T
   :answer_a: A solution to a problem that can be solved by a computer.
   :answer_b: A step by step list of instructions that if followed exactly will solve the problem under consideration.
   :answer_c: A series of instructions implemented in a programming language.
   :answer_d: A special kind of notation used by computer scientists.
   :correct: b
   :feedback_a: While it is true that algorithms often do solve problems, this is not the best answer.  An algorithm is more than just the solution to the problem for a computer.  An algorithm can be used to solve all sorts of problems, including those that have nothing to do with computers.
   :feedback_b: Algorithms are like recipes:  they must be followed exactly, they must be clear and unambiguous, and they must end.
   :feedback_c: Programming languages are used to express algorithms, but an algorithm does not have to be expressed in terms of a programming language.
   :feedback_d: Computer scientists sometimes use a special notation to illustrate or document an algorithm, but this is not the definition of an algorithm.

   An algorithm is:


