Вы находитесь на странице: 1из 7

Write-up Of Computer Application & Management Information System

On Algorithm

Submitted to: Dr. Rekha Prasad FMS, BHU Varanasi

Submitted by: Arjun Kafle MBA 2008-10 Roll No- 04

The word algorithm comes from the name of the 9th century Persian astrologer Abu Abdullah Muhammad bin Musa al-Khwarizmi. According to Carl B. Boyer, author of The History of Mathematics (1968) al-Khwarizmi wrote numerous books on arithmatics, and algebra. One of his books, "De numero Indorum" (Concerning the Art of Hindu Reckoning) was based on the Arabic translation of Brahmagupta where he described the Hindu digits of zero, 1,2,3, through the number 9 and the decimal place value that was a recent arrival from India. The word algorism originally referred only to the rules of performing arithmetic using Hindu-Arabic numerals but evolved via European Latin translation of al-Khwarizmi's name into algorithm by the 18th century. The word evolved to include all definite procedures for solving problems or performing tasks. The first case of an algorithm written for a computer was Ada Byron's notes on the analytical engine written in 1842, for which she is considered by many to be the world's first programmer. However, since Charles Babbage never completed his analytical engine the algorithm was never implemented on it. The lack of mathematical rigor in the "well-defined procedure" definition of algorithms posed some difficulties for mathematicians and logicians of the 19th and early 20th centuries. This problem was largely solved with the description of the Turing machine, an abstract model of a computer formulated by Alan Turing, and the demonstration that every method yet found for describing "well-defined procedures" advanced by other mathematicians could be emulated on a Turing machine (a statement known as the Church-Turing thesis).

Algorithms are the foundation of computer Science, it is telling the computer to do the task in the most efficient matter. An algorithm is particularly important in optimizing a computer program; the efficiency of the algorithm usually determines the efficiency of the program as a whole. According to the popular algorithms textbook Introduction to Algorithms, "an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values as output." In other words, algorithms are like road maps for accomplishing a given, well-defined task. So, a chunk of code that calculates the terms of the

Fibonacci sequence is an implementation of a particular algorithm. Even a simple function for adding two numbers is an algorithm in a sense, albeit a simple one.

One of the most important aspects of an algorithm is how fast it is. It is often easy to come up with an algorithm to solve a problem, but if the algorithm is too slow, it's back to the drawing board. Since the exact speed of an algorithm depends on where the algorithm is run, as well as the exact details of its implementation, computer scientists typically talk about the runtime relative to the size of the input. For example, if the input consists of N integers, an algorithm might have a runtime proportional to N2, represented as O(N2). This means that if you were to run an implementation of the algorithm on your computer with an input of size N, it would take C*N2 seconds, where C is some constant that doesn't change with the size of the input.

Some of the common examples of Algorithms are: Washing machine instructions Instructions for a ready-to-assemble piece of furniture Finding the greatest common divisor (GCD) using Euclids Algorithm Finding the square root of a number

The Washing machine Instructions are as follows: Separate clothes into white clothes and colored clothes. For white clothes: Set detergent to tub. Close lid and press the start button. Water temperature knob to HOT. Place white laundry in tub.

For colored clothes: Set water temperature knob to COLD. Place colored laundry in tub. Add 1 cup of powdered laundry

After making observations about the Washing Machine Instructions, We know that in algorithm There are a finite number of steps. We are capable of doing each of the instructions. When we have followed all of the steps, the washing machine will wash the clothes and then will stop.

Euclids Algorithm

Problem: Find the largest positive integer that divides evenly into two given positive integers (i.e., the greatest common divisor). Steps: Assign M and N the values of the larger and smaller of the two positive integers, respectively. Divide M by N and call the remainder R. If R is not 0, then assign M the value of N, assign N the value of R, and return to Step 2. Otherwise, the greatest common divisor is the value currently assigned to N.

Types of Algorithms:
1) Simple recursive algorithms: A simple recursive algorithm: Solves the base cases directly Recurs with a simpler sub-problem Does some extra work to convert the solution to the simpler sub-problem into a solution to the given problem I call these simple because several of the other algorithm types are inherently recursive

2) Divide and conquer algorithms: A divide and conquer algorithm consists of two parts: Divide the problem into smaller sub-problems of the same type, and solve these sub-problems recursively Combine the solutions to the sub-problems into a solution to the original problem

Traditionally, an algorithm is only called divide and conquer if it contains two or more recursive calls.

3) Dynamic programming algorithms: A dynamic programming algorithm remembers past results and uses them to find new results. Dynamic programming is generally used for optimization problems.

4) Greedy algorithms: An optimization problem is one in which you want to find, not just a solution, but the best solution. -A greedy algorithm sometimes works well for optimization problems -A greedy algorithm works in phases: At each phase: You take the best you can get right now, without regard for future consequences You hope that by choosing a local optimum at each step, you will end up at a global optimum

5) Branch and bound algorithms: Branch and bound algorithms are generally used for optimization problems. The Steps are:

a. As the algorithm progresses, a tree of sub-problems is formed b. The original problem is considered the root problem c. A method is used to construct an upper and lower bound for a given problem d. At each node, apply the bounding methods i. If the bounds match, it is deemed a feasible solution to that particular subproblem ii. If bounds do not match, partition the problem represented by that node, and make the two sub-problems into children nodes e. Continue, using the best known feasible solution to trim sections of the tree, until all nodes have been solved or trimmed.

6) Brute force algorithms: A brute force algorithm simply tries all possibilities until a satisfactory solution is found. a. Such an algorithm can be: i. Optimizing: Find the best solution. This may require finding all solutions, or if a value for the best solution is known, it may stop when any best solution is found. 1. Example: Finding the best path for a travelling salesman ii. Satisficing: Stop as soon as a solution is found that is good enough 1. Example: Finding a travelling salesman path that is within 10% of optimal

7) Randomized algorithms: A randomized algorithm uses a random number at least once during the computation to make a decision. a. Example: In Quicksort, using a random number to choose a pivot b. Example: Trying to factor a large prime by choosing random numbers as possible divisors

References:
www.cs.virginia.edu/~luebke/cs332/ www.cs.princeton.edu/gfx/proj/sg05lines/course7-7-algorithms.pdf www.icaen.uiowa.edu/~comp/Public/Apriori.pdf www.wikepedia.com www.Scribd.com

Вам также может понравиться