Algorithms the perimeter for this rectangle, for some

Algorithms are a set of step-by-step instructions that satisfy a certain set of properties. In this lesson, we’ll explore the properties an algorithm must satisfy in order to be useful using an example.

Algorithms

Have you ever tried to assemble a piece of furniture by yourself? If so, you probably used a set of step-by-step instructions to assist you in your endeavor. Wouldn’t it be nice if math problems came with a set of instructions like this? Oh wait, they do!When solving a math problem, we usually use an algorithm, or a set of step-by-step instructions. For example, suppose we’re trying to figure out what the perimeter of a rectangle with length 5 units would be for various widths.

Our Authors Write a Custom Essay
For Only $13.90/page!


order now

Since the formula for the perimeter of a rectangle is:

  • P = 2l + 2w, where l = length and w = width

we can plug in 5 for l to get P = 2(5) + 2w = 10 + 2w. Ultimately, we’re trying to find the different values of P for various values of w, where

  • P = 10 + 2w

To figure out the perimeter for this rectangle, for some width w, we follow these steps:

  1. Multiply w by 2.
  2. Add 10 to the result. This is the perimeter.


This is an example of an algorithm. It is a set of steps that we can follow in order to find the perimeter of the rectangle for a given width, w. Now suppose we want to know what the perimeter of this rectangle would be if it had a width of 8 units.

Again, we can use our algorithm.

  1. Multiply 8 by 2: 8 ⋅ 2 = 16
  2. Add 10 to the result: 16 + 10 = 26

Here we end up with a perimeter of 26 units. Now let’s discuss some of the properties of algorithms.

Properties

In order for an algorithm to be useful, it must help us find a solution to a specific problem. For that to happen, an algorithm must satisfy five properties.

  1. Input: The inputs used in an algorithm must come from a specified set of elements, where the amount and type of inputs are specified.

  2. Output: The algorithm must specify the output and how it is related to the input.
  3. Definiteness: The steps in the algorithm must be clearly defined and detailed.
  4. Effectiveness: The steps in the algorithm must be doable and effective.
  5. Finiteness: The algorithm must come to an end after a specific number of steps.

When an algorithm satisfies these five properties, it is a fail-proof way to solve the problem for which it was written.

Sample Problem

To further our understanding of these five properties, let’s take a look at our opening example where we used an algorithm to find the perimeter of a rectangle with length 5 units for various widths and see how it satisfies each of the properties.

  1. Input: The inputs of this algorithm are clearly specified as possible widths of the rectangle. Basically, consists of positive real numbers, since we can’t have a negative width.
  2. Output: The outputs of the algorithm are also clearly specified as the perimeter of the rectangle based on the given width. Again, we’re dealing with positive real numbers since a perimeter must be positive. Furthermore, the perimeter of this particular rectangle must be greater than 10 since the length of 5 accounts for 10 units of the perimeter.

    All together, we’re dealing with outputs of real numbers that are greater than 10. If we get an output that is not a real number greater than 10, then we know we made an error somewhere.

  3. Definiteness: The two steps of the algorithm are clearly defined and detailed. The actions of each step are clearly stated and easy to follow.
  4. Effectiveness: Each step in the algorithm is very doable. The first step is a matter of multiplication, and the second step is a matter of addition.

  5. Finiteness: The algorithm comes to an end after two steps, so it is finite. After we complete the second step, we have the perimeter, so the algorithm is complete.

Since our algorithm satisfies the five properties of an algorithm, it can always be used to find the perimeter of a rectangle, with length of 5 units, for some width, w.

Lesson Summary

In the same way that a piece of furniture can be assembled by following a set of step-by-step instructions, a math problem can be solved using an algorithm. An algorithm is a set of step-by-step instructions used to solve a math problem.

For an algorithm to be useful, it must satisfy five properties:

  1. The inputs must be specified.
  2. The outputs must be specified.
  3. Definiteness
  4. Effectiveness
  5. Finiteness

When an algorithm satisfies these properties, it is fail-proof method for solving a designated type of problem. As such, algorithms are useful, not only in mathematics and computer programming, but also in any other area where step-by-step instructions are beneficial.

For example, you may have never have thought of a dinner recipe as a mathematical concept, but now that you know the directions are a type of algorithm, you may never look at them in the same way again!

x

Hi!
I'm Sigvald

Do you need a custom essay? How about ordering an essay here?

Check it out