## CS 1401 Homework #1

**Date Assigned:** Thursday, January 13, 2005
**Due Date:** Tuesday, January 18, 2005, before the beginning of
your lecture section.

The goal of this assignment is to better understand the notion of an
algorithm.

**Problem 1: Solving Quadratic Equations**

Describe an algorithm for solving quadratic equations. Given three
real numbers *a*, *b*, and *c*, we must find the values
*x* for which *a*x^2+b*x+c=0*.

The general formula for solving quadratic equations is:
*x=(-b+-sqrt(b^2-4a*c))/(2a)*. Similarly to the way we analyzed
the solution to linear equations, please take into account that this
formula is not always applicable:

- we can have
*a=0*; in this case, the quadratic equation
turns into a linear equation, and we already know how to solve linear
equations;
- it is also possible that
*b^2-4a*c<0*, in which case the
quadratic equation has no solutions at all.

**Problem 2: Navigating a Maze**

Describe an algorithm for navigating a maze and test it on an example
of a maze that you draw yourself.

*Comment:* It is OK if this algorithm does not
always work, but check that it works on the maze you have drawn
yourself.

**Deliverables**

Write your answers on a sheet of paper with your
name on it, and turn it on right before the class.