What is Algorithm: Definition and 721 Discussions

In mathematics and computer science, an algorithm ( (listen)) is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of specific problems or to perform a computation. Algorithms are always unambiguous and are used as specifications for performing calculations, data processing, automated reasoning, and other tasks. In contrast, a heuristic is a technique used in problem solving that uses practical methods and/or various estimates in order to produce solutions that may not be optimal but are sufficient given the circumstances. As an effective method, an algorithm can be expressed within a finite amount of space and time, and in a well-defined formal language for calculating a function. Starting from an initial state and initial input (perhaps empty), the instructions describe a computation that, when executed, proceeds through a finite number of well-defined successive states, eventually producing "output" and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic; some algorithms, known as randomized algorithms, incorporate random input.The concept of algorithm has existed since antiquity. Arithmetic algorithms, such as a division algorithm, were used by ancient Babylonian mathematicians c. 2500 BC and Egyptian mathematicians c. 1550 BC. Greek mathematicians later used algorithms in 240 BC in the sieve of Eratosthenes for finding prime numbers, and the Euclidean algorithm for finding the greatest common divisor of two numbers. Arabic mathematicians such as al-Kindi in the 9th century used cryptographic algorithms for code-breaking, based on frequency analysis.The word algorithm itself is derived from the name of the 9th-century mathematician Muḥammad ibn Mūsā al-Khwārizmī, whose nisba (identifying him as from Khwarazm) was Latinized as Algoritmi. A partial formalization of the modern concept of algorithm began with attempts to solve the Entscheidungsproblem (decision problem) posed by David Hilbert in 1928. Later formalizations were framed as attempts to define "effective calculability" or "effective method". Those formalizations included the Gödel–Herbrand–Kleene recursive functions of 1930, 1934 and 1935, Alonzo Church's lambda calculus of 1936, Emil Post's Formulation 1 of 1936, and Alan Turing's Turing machines of 1936–37 and 1939.

View More On Wikipedia.org
  1. B

    Algorithm question - totally lost

    Homework Statement Write an algorithm that returns the index of the first occurence of the largest element in the sequence s1,...,sn. Example: If the sequence is 6.2 7.9 4.2 8.9 the algorithm returns the value 4. I am new here...I read the rules. I am...
  2. S

    Best ODE algorithm to use for time/velocity independent potentials?

    Hello, I am not sure if this is the right place to ask this, but I don't readily see a "numerical methods" forum here so I assumed this would be the place to go. Sorry if I overlooked another place to post this! Anyway, I have some points interacting via potentials that are dependent only on...
  3. M

    Algorithm for solving system of nonlinear equations

    I'm trying to find an algorithm to solve a 4 variable system of nonlinear equations.. the variables are named w,x,y,z and a,b,c,d are constants: a = x - y + z b = w + x c = y * z d = x * y / w Can anyone offer any advice? Much appreciated...
  4. D

    Calculating Square Roots - Matrix Algorithm

    Hi. I only just recently found out about an algorithm for calculating the square roots of a number. Lets say i want to evaluate \sqrt {n}. I can make an approximation by inspection, and say \sqrt n \approx \frac{a}{b}. Now, using this approximation, i can write: \left[...
  5. D

    Can You Explain How to Perform UL-Factorization of a Matrix?

    LU-Factorization Algorithm?? Homework Statement Develop an algorithm for finding directly the UL-factorization of a matrix A, where L is a unit lower triangular and U is upper triangular. Give an algorithm for solving ULx=b. Homework Equations I'm not sure how to tackle this problem since...
  6. F

    Solving Connected Graphs with Algorithm: K Blue/Red Edges

    Homework Statement Given a connected graph G = (V,E). Let n = |V |. Each edge in G is already colored with either RED or BLUE. Devise an efficient (i.e. polynomial-time) algorithm which, given an integer k, 1 <= k <= n − 1, either (a) returns a spanning tree with k BLUE edges and n − 1 −...
  7. V

    What is the most useful algorithm ever written?

    Which algorithm is the most useful and compact that anyone has written?
  8. Mentz114

    Need an algorithm to calculate a function

    I'm trying to calculate a table of x vs t, with x as the dependent variable from this formula t + C = \frac{1}{2}(x\sqrt( 1 - x^2) + arcsin(x) ) C=0.4783 is given when t=0 and x = 1/2 I thought it would be simple but my code is giving nonsensical results, viz. a straight line ! I do...
  9. B

    Write Algorithm to Find the Index of Largest Element in Sequence

    I am having the hardest time getting this algorithm written: Write an algorithm that returns the index of the first occurrence of the largest element in the sequence s1,..., sn. If the sequence is 6.2, 8.9, 4.2, 8.9, the algorithm returns the value 2. Input: s, n Output: ?? I'm...
  10. H

    List of increasing integers algorithm

    Specify the steps of an algorithm that locates an element in a list of increasing integers by successively splitting the list into four sublists of equal (or as close to equal as possible) size, and restricting the search to the appropriate piece. (Hint: see binary search algorithm.) can...
  11. B

    Algorithm to find smallest element

    I'm working on an algorithm that finds the smallest element among a, b, and c. Here is what I have so far: Input: a,b,c Output: small; smallest element in the sequence a,b,c a = 2, b = 4, c = 3 Small = a If b < small, then small = b If c < small, then small = c Is...
  12. H

    Help with Algorithm Homework: Locating Last Occurrence of Smallest Element

    hello any one can help me with this thanx The Horner’s method is an algorithm that evaluates polynomials. The following pseudocode shows how to use this method to find the value of anxn + an-1xn-1 + . . . + a1x + a0 at x = c. procedure Horner(c, a0, a1, a2, . . . , an : real numbers) y...
  13. A

    Quantum Algorithm: Implementing Shor's & Finding Simpler Algorithms

    For a computer science project I am creating a simulation of quantum computer memory structure and operations and implementing Shor's algorithm for number factorization. I have been readings its steps and sort of get it but I want to see a simpler quantum algorithm in action to solidify my...
  14. 0

    Check for Cycles in Undirected Graphs: O(|V|) Algorithm

    I'm just posting a random graph algorithm problem for discussion fodder, since another interesting graph algorithm post was removed due to a threatening-sounding title and lead-up. This is from Cormen, Leiserson, Rivest, & Stein, 22.4-3 (not a homework problem of any kind, just for fun--I had...
  15. S

    Mathematica Solving Math Algorithm Problem with rand(1,1) Function

    Hello I have to write an algorithm that randomly chooses between A B and C. I have to use the function (rand(1,1) which gives me a radndom number from the following (0,1,2,3,4,5,6,7,8,9).. I was thinking of assigning A = 1:3 B = 4:6 C = 7:9 But I run into the problem of the random...
  16. S

    MATLAB Matlab, mathematical algorithm

    Hey there, I was just wondering if anyone in here could help me out with a short algorithm I have to write for my class. Lets say the function fix(10*rand(1,1)) gives u a random number out of (0,1,2,3,4,5,6,7,8,9) now, you need to use the number from the generator to pick out of 3...
  17. P

    Using Reducible Polynomials for Factoring Natural Numbers

    [Of course some of you will let me know if we need numerical examples or if something just does not make sense, or if it is very similar to what somebody else has already done, and I appreciate that.] Suppose we have a reducible polynomial over the natural numbers (zero include) such that...
  18. C

    Greedy Algorithm & Optimal Coin Change

    I'm not sure that this is the right place for this post, but I couldn't find a better. Many years ago I considered the problem of making change with (say) quarters, dimes, nickels, and pennies. I tried to prove to myself that what I now call the greedy algorithm (pick the most valuable coin...
  19. S

    Question on theorem of arithmetic euclid's algorithm

    http://img143.imageshack.us/img143/7461/divsuu6.jpg i know this question has to do with theorem of arithmetic and euclidean algorithm, but i don't even know where to start. help pls! thank you!
  20. S

    Euclidean Algorithm: Understanding Division

    http://img82.imageshack.us/img82/4458/divisonfx9.jpg
  21. G

    Think of a good algorithm for this program

    I just can't think of a good algorithm for this program after two days. There are n persons (you take n from the user) and you have to permute them in room 1 and room 2 for all possible number of permutations. If the number of persons in a room are same then they should be sorted according to...
  22. T

    Develop the algorithm as a module

    Consider the following specification: pre n >= 1 post search module(a, n, number) = FOUND(a, number) reads a, n, number changes - mem - Remark: Let i be an integer number. Then, FOUND = 0 iff a does not contain number and FOUND = i iff a[i] = number. search module is the name of...
  23. T

    Understanding Polynomial Time Complexity

    can sombody pls explain to me what does exponential time algorithm means?? thanx
  24. T

    Parallel Algorithm for Addition of Two Digit Numbers

    by means of the parallel algorithm , let says addition of two digits number in each row requiring n/2 processors and taking time proportional to log n / log 2 . for the ques above, i do not understand why it takes time of log n / log 2 . can smby pls explain to me thanx
  25. W

    A Puzzle - Algorithm Needed or Involved?

    I am trying to solve a puzzle. How do I find an algorithm (or a formula) behind a series of six two-digit numbers? (The numbers are as follows: 14, 21, 33, 41, 56, 68.) The two-digit numbers, although different from one another, are always the same ones given. Each time they are rearranged...
  26. P

    Candle flicker algorithm and hardware

    I was looking at some of those battery operated candles that flicker like real candles, and asked myself, "how hard would that be to make?" The main problem being, I have very little knowledge of electrical engineering. Even if I had an algorithm, I wouldn't know how to implement it into...
  27. P

    Is There Merit in Experimentation for Mathematical Discoveries?

    Consider the following true statement. Given natural numbers n, m, s (1) \sum_{i=0}^n a^i = \sum_{i=0}^s a^{(m+1)i} \sum_{i=0}^m a^i iff (2) n+1=(m+1)(s+1) Now suppose that N is a natural number where (3) N = \sum_{i=0}^n a^i Now restrict a to the natural...
  28. K

    Can Dijkstra's Algorithm Generate a Breadth-First Tree?

    Does anyone here know how to prove this? I'm stuck on how to even get this started. Let G be a connected, weighted and undirected graph where all edges have a weight of 1. Prove that if Dijkstra's algorithm is run on this graph, G, then the tree returned is a breadth-first tree.
  29. H

    Fast algorithm for finding number of p less than n

    Hello, I'm looking for some good and fast algorithm to find all prime numbers less than a given number. I've got a simple program which finds all primes less than any number, but once n gets above 500,000 it takes much too long. (More than 5 minutes. Just up to 100000 it takes about 7...
  30. S

    Diophantine Equation and Euclid's algorithm

    Given that x and y are positive integers such that: 13x + 4y = 100 Then, what is x + y like? Personally, I found the answer using Euclid's algorithm. d = gcd(13,4)=1 13 * u + 4 * v = 1 (u, v) = (1,-3) (x,y) = (100, -300) 13 * (x - 100) = 4 * (y + 300) (Gauss) x =...
  31. S

    Euclid's Algorithm Explained: Modulo n & Remainders

    I can do it, but can't understand how it works. Is there a straightforward expalnation in terms of \ \mathbb{Z}_{n} the set of remainers in modulo n? Could someone try to explain, pls.
  32. P

    Exploring Shor's Algorithm: Factoring Integers

    I'm playing around with the algorithm and I'm having some confusion: the algorithm is as follows: to factorize some integer N pick some integer a such that a < N. then compute the function f(x) = a^x mod N f(x) will be periodic with period r, then to find the factors you find the greatest...
  33. S

    Metropolis algorithm for Kosterlitz-Thouless model

    Hello everybody... I have questions about how to implement the metropolis algorithm to the Kosterlitz-Thouless model. Many questions!:cry: When I create a LxL lattice I give an angle for every spin vector in every position (i,j) of the lattice or the projection of the vector? The Hamiltonian...
  34. H

    Symplectic Algorithm for Non-Separable Hamiltonian

    Hi, I have this hamiltonian K = \frac{1}{2}(P_1^2 + P_2^2) + P_1 Q_2 - P_2 Q_1 - (\frac{1-\mu}{R_1}+\frac{\mu}{R_2}) (see this link if there is any latex problem) with non separable variables. I am looking for a symplectic algorithm (runge kutta would be good) to solve the correspondant...
  35. N

    Devise Recursive Algorithm for x^n % m

    Devise a recursive algorithm for finding x^n \bmod m whenever n, x, and m are positive integers, based on the fact that x^n \bmod m = (x^{n-1} \bmod m \cdot x \bmod m) \bmod m can anyone give me some hints? i don't know where to start :frown: thank you
  36. C

    Can You Help Me Find an Algorithm to Fill a Grid Without Repeating Places?

    Hi: I'm looking for an algorithm to fill a grid without repeating places. I have looking for Pseudorandom number lists (http://en.wikipedia.org/wiki/List_of_pseudorandom_number_generators#gsl_rng_minstd) but i do not get it clearly... Any help ? :)
  37. T

    Algorithm for finding optimal boolean formula

    EDIT: I'm sorry for confusing topic title, my thoughts were somewhere else :) Hello to all, I'm going to write program which will be finding all strongly connected components of hypergraph. Strongly connected component is such connected maximal subhypergraph that there exists bidirectional...
  38. V

    Algorithm for min times the ball to be weighted

    There are 6561 balls out of them 1 is heavy. Find the min. no.of times the ball have to be weighted for finding out the heavy ball.
  39. R

    Algorithm for an elliptic equation

    Hello, I'm trying to create my own version of the Sieve of Atkin for my Algorithm class final project, but ran into a wall. I want to be able to create a method of algorithmically finding the number of integer coordinate pair solutions such that x > 0 and y > 0 for the following equations...
  40. A

    An algorithm based on Eratosthenes Sieve

    Modify the Eratosthenes Sieve to count the number of all divisors of the given number. Find an algorithm which for given number N <= 10000 will create a field of N numbers such that the value of the i-th element of the field is the number of all divisors of the number i for each i <= N, but the...
  41. B

    Numeric algorithm (of projectile motion with drag)

    Using the suggested algorithm steps of the University Physics extra http://wps.aw.com/wps/media/objects/877/898586/topics/topic01.pdf" I want to make Maple (ver. 10) output values for coordinates, speeds and accelerations (as described in the linked PDF). I've reached the 5th step, which is...
  42. S

    Learn Cholesky Algorithm for Reducing Matrices by Thursday

    This is not a homework question per se, but i would like to understnad the cholesky method of reducing matrices before my test on thursday up till now every search on the net has found me computer algorithms but i can't really understand those and apply those pracitcally so givne some matrix...
  43. marcus

    Jones gives quantum algorithm for Jones knot polynomial

    http://arxiv.org/abs/quant-ph/0511096 A Polynomial Quantum Algorithm for Approximating the Jones Polynomial Dorit Aharonov, Vaughan Jones, Zeph Landau 26 pages "The Jones polynmial, discovered in 1984, is an important knot invariant in topology, which is intimately connected to Topological...
  44. J

    Solving a Complex Algorithm Problem: Get Person's Ages and Determine Who's Older

    Hi there. I have two algorithm problems. I was wondering if you can check my answers for the first one and help me get a start with the second one: 1)Write an algorithm to compute the average of 5 numbers Name: Ave5 Given: X1, X2, X3, X4, X5 Change: none Intermediate: Total Result...
  45. R

    Cantor Expansion Addition algorithm?

    Could someone help me and write an algorithm to add 2 Cantor expansions. The algorithm to get a decimal number to cantor expansion is: procedure decimal-to-cantor(x: positive integer) n := 1 y := x fy is a temporary variable used so that this procedure won't destroy the original value of...
  46. M

    Extended euclidian algorithm problem (HELP )

    Extended euclidian algorithm problem (HELP!) Hi I have this here example problem: 9x - 65y = 1 I'm suppose to use the extended euclidian algorithm, but it has given me such much trouble. I get the regular euclidian algorithm, but not the extended one. Therefore if there is...
  47. L

    Algorithm for Throwing Grad Students Out of Buildings - Algorithm Ponderer

    This is a problem that was posed by our professor when taking algorithms years and years ago. Unfortunately I can't recall terribly much about his solutions and (rather lengthy) musings on it, so I don't have a "correct" or "optimal" answer as such. Since I don't have a more normally worded...
  48. B

    Finding Multiplicative Inverse of 23 in Z_31

    There's something that's been bothering me with the division algorithm for a while. a = dq + r where r < |d| and a,d,q,r are integers. This can be used to find the multiplicative inverse of an integer in Z_m where m is an integer if certain conditions are satisfied. For example if I had two...
  49. K

    Algorithm Analysis: Sorting Arrays in A_k with Constant Cn

    In the problems below A[1, ..., n] denotes an array consisting of arbitrary n real numbers, and A[j] denotes the element in the j-th place of the array A[1, ..., n]. 1) Let k be a fixed natural number. Consider the family A_{k} of all arrays A[1, ..., n] satisfying that for every i ≤ n there...
  50. B

    Can This Greedy Algorithm Help Anatjari Minimize His Desert Stops?

    Hi :smile: This is a simple algothim problem,please help me solve it .I think its a greedy problem Here it is: ------------------- A native austratial named anatjari wants to cross a desert carrying only one bottle of water.He has a map that marks all the watering holes along the way...
Back
Top