Algorithm Definition and 724 Threads

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. M

    Extended euclidean algorithm and Chinese Remainder theorem

    Homework Statement Solve x \cong 1 mod 7 x \cong 4 mod 6 x \cong 3 mod 5 by (and I have to use this method) using Euclidean algorithm to find the largest common divisor, then the extended euclidean algorithm to find a linear combination, then a solution to each of the three...
  2. M

    MHB Finding Shortest Path in G: Dijkstra's Algorithm

    Helloo! I am asked to find the weights of the shortest path from s in a directed Graph G=(V,E), where V={s,a,b,c,d}, E={(s,a),(s,d),(a,b),(a,c),(a,d),(b,s),(b,c),(c,b),(d,a)} and their weights 5,3,6,4,1,3,7,2,2... I used Dijkstra's Algorithm, and I found d[s]=0,d[a]=5,d[b]=11,d[c]=9,d[d]=3...
  3. T

    How Do DOLLS and SLLOD Algorithms Differ in Molecular Dynamics?

    Apparently, this is the DOLLS tensor Hamiltonian: [ tex ] H = H_0 + \sum q_i p_i : ∇u(t)^T [ /tex ] These are the derived equations of motion: [ tex ] \dot{q}_i = p_i/m + q_i \cdot ∇u [ /tex ] [ tex ] \dot{p}_i = F_i - ∇u \cdot p_i [ /tex ] And these are the SLLOD equations of motion: [...
  4. S

    What should the proper name for the QuickSort algorithm be?

    OK, I understand the deal - it was the (and seems to still be) the fastest algorithm for sorting a random set (although it can break down to O(n2) for the worst case non-random.) But it seems that it should have a name that describes its essence, like MergeSort or InsertionSort. The essence of...
  5. O

    Testing Algorithm for Global Minima of Test Functions

    I'm testing an algorithm to find the global mimina of a function. Can someone give me a few examples of optimization test functions in 2 or 3 dimensions, like the Rastrigin function. I'm hoping to find functions with several local minima.
  6. M

    Python What is the Purpose of the Arc Function in Python's Turtle Graphics?

    Hi, I'm working through thinkpython and there is an exercise which requires drawing flowers and arcs. I'm having some trouble understanding the arc function. def arc(t, r, angle): """Draws an arc with the given radius and angle. t: Turtle r: radius angle: angle subtended by the...
  7. C

    Velocity and acceleration algorithm

    Homework Statement Why are (2) and (4) equations more accurately than (1) and (3) ? Why is 7*dt in (4) equation ? What kind of equations are (2) and (4) ? What method they used to write (3) and (4) equations? Homework Equations Velocity: (1) v[i] = (x[i] - x[i-1]) / (t[i] - t[i-1])...
  8. X

    Algorithm or expression to put n elements in k sets

    I have 17 elements, and I want to put them in 3 sets. This makes 2 sets with 6 elements, and 1 set with 5 elements. Now I want to find an algorithm to partition n elements in k sets. Can anyone give me an algorithm, or a math expression for me to implement in a algorithm? Thanks
  9. C

    Need help understanding Remez Algorithm and Chebyshev Polynomials

    So I've been reading about minimax polynomial approximations and have found them to be pretty impressive. However, i am confused on exactly how to determine the constants. The first step is supposed be solving for the Chebyshev polynomials as an initial guess. I'm reading wikipedia but I'm a...
  10. J

    Help me make a very mathematical encryption algorithm

    Suppose I make an application with a password of max 20 characters -- no special characters and not case-sensitive. So that means there is a 1-to-1 correspondence between the set of all passwords P and the set S = {1, 2, ..., 3720 - 1, 3720}. A simple bijective function f:P-->S could be...
  11. N

    Turing machine depth-first search algorithm

    Homework Statement On the tapes of Turing machine recorded the number of vertices (n) in the binary system, the length of the desired cycle - k (in binary), and the adjacency matrix of the graph. Required to construct a Turing machine, which checks for the cycles of k-length in the graph, and...
  12. M

    MHB Improvement algorithm and its time complexity

    Hi, I have a problem with the following problem: Assume fj is concave and strictly increasing for all j, j=1,..,n. Show that the optimal solution x* satisfies the condition (from j=1 to n) ∑x*j=B. Now consider the following improvement algorithm: start with x0=0 for k=1:B select...
  13. A

    An algorithm for data compression?

    An algorithm for data compression? I am coming from a philosophy and science background and I'm particularly interested in finding out what a generalised data compression algorithm would look like. (By algorithm I mean something like a flowchart that would show how this process could be...
  14. D

    What Does the 'Split' Function Do in Google's Go Language Tutorial?

    So I decided today I wanted to learn a new programming language (for fun). Normally I would ask this on a general purpose programming site, but I figured perhaps this might be a better place for algorithms of this type? In the tutorial for Google's "Go" language I came across this, and I am...
  15. I

    Modifying a Gaussian Elimination Algorithm to Perform Gauss-Jordan E.

    Homework Statement I have an algorithm that implements Gaussian elimination. According to the text, with some modification of the indices and their in the loops, I should be able to have this algorithm perform Gauss-Jordan elimination. I also have to reduce the matrix to reduced row-echelon...
  16. M

    EM algorithm convergence KF log likelihood decrease

    Hi everyone, Im running the KF to learn parameters of a model, the log likelihood of the p(Y_{k}|Y_{k-1}), however decreases. Can anyone advise, does this mean my implementation is wrong or can this just be the case. Advice appreciated Thanks
  17. T

    Using the Euclidean algorithm .I think

    Using the Euclidean algorithm...I think... find the smallest natural number x such that 24x leaves a remainder of 2 upon division by 59 SO it seems to me that the way to approach this would be through the euclidean algorithm and a diophantine equation. Thinking about it for a moment would...
  18. A

    Levenberg marquardt C coding algorithm

    HI guys. Haven't been here in a while... I have an algorithm attached that uses the levenberg marquardt non linear curve fitting alogrithm to fit a surface. My C coding skills are reasonable, however I am struggling to adjust the model so that I can fit my curve to it. I want to use this...
  19. B

    Algorithm for multidimensional constrained root finding

    Hi all, I'm looking for an algorithm for multidimensional constrained root finding, implemented in Fortran. It's intended for finding a steady-state solution for a dynamic model. I have n state variables and n coupled differential equations (n~=60), and I need to find the value for the state...
  20. maistral

    Numerical Methods for PDEs, basic algorithm?

    This is actually a request, I don't know if these are the correct forums for me to post these kinds of things, but yeah. Alright. I intended to study and learn numerical methods with PDEs on my own. And sadly the only thing I can comprehend is the Liebmann method. :cry: And I got so little...
  21. J

    Looking for tips on a recommendation algorithm

    Hi everyone, Long time lurker, first time poster! I'm developing a website where users can read and participate in discussions, articles and questions. I'm currently developing an algorithm that will recommend to each user discussions, articles and questions that they would be interested in...
  22. K

    Determining efficiency of multiplication algorithm

    Hi I'm writing a BigNum library for Javascript and have come up with a multiplication algorithm which I think is pretty efficient (a modification of shift/add), but I don't understand O(log ...) notation, so don't really know how to compare my method with something like the Schönhage–Strassen...
  23. M

    Convert algorithm to a formula

    Hi Please can someone help me convert this algorithm to a mathematical formula ? function fun(int x) { int c = 0 ; for(int i=2;i<floor(x/2);i++) { if(floor(x/i) > i-1) for(int j=0;j<floor(x/i)-i+1;j++) c++; } return c; } thanks
  24. S

    Division Algorithm proof explanation

    This is taken from "Passage to Abstract Mathematics," Watkins and Meyer. "Theorem 2.3.9 (Division Algorithm) If a \in\mathbb{Z} and b\in\mathbb{N}, then there exist q,r \in\mathbb{Z} such that a = qb+r and 0 \leq r < b. Furthermore, for each b\in\mathbb{N}, this representation of a is unique...
  25. R

    Algorithm for optimized diversification of x members over y equal groups

    Hoping to get some assistance here on a volunteer project I am working on. I am writing a program for my bicyle club in preparation for our spring training series. We will have x participants that will be divided weekly into y number of (approximately) equal groups containing z members per...
  26. V

    General algorithm for a magic square

    Is there any algorithm to form a magic square of any size with a desired magic sum ? Also can we make a magic square not only with the numbers from 1 to n2 but using any random numbers ?
  27. S

    MATLAB code for Aldous-Broder algorithm from spanning trees of a graph

    Homework Statement Let G = (V,E) be a graph with vertices V and edge set E. Aldous-Broder algorithm: Input: G = (V,E) Output: T = (V, W), where W is a subset of E such that T is a spanning tree of G. Let W be the empty set. Add edges to W in the following manner: starting at any...
  28. J

    Could someone explain to me how this clustering algorithm works?

    So MathWorks.com shows this as an example: d = pdist(meas); Z = linkage(d); c = cluster(Z,'maxclust',3:5); http://www.mathworks.com/help/stats/cluster.html. I'm confused about why the routine gives any useful information. First it returns the Euclidean distances between values in some array...
  29. K

    How to Analyze Bubble Sort Algorithm Efficiency?

    Hello, I need to analyze some bubble sort algorithm and calculate the probability of each conditional statements(if,for,while,ect...) be successful. I can post the algorithms if you need to see them. Thanks in advance
  30. C

    What Is the Best Algorithm for Finding the Cheapest Supplier Combination?

    I have a problem in which I have people ordering different goods from my website and I have a number of suppliers who provide these goods, but I need an algorithm to find the cheapest combination of supplies from each supplier. It would seem easiest to just see which company offers the product...
  31. P

    Metropolis Algorithm - Why does it work?

    I'm doing a project based around the Metropolis algorithm to explore parameter spaces.The computational aspect I can understand and implement. I understand that a Markov Chain is constructed in the parameter space. However, I don't understand the theory behind why it works so well in exploring...
  32. F

    Java Trying to come up with simple algorithm of significant time complexity in Java

    Hi PF, I'm working on a program that requires measuring how long it takes a given computer to process a certain task, but am having trouble coming up with algorithms that won't take most computers a trivial amount of time to perform. The only one I've got so far is recursively computing...
  33. P

    Algorithm for testing intersection of point and compound polygon

    I'm trying to find a reasonably fast method for testing whether or not a point (x,y euclidean coordinate system) lies inside a (preferably convex, concave or complex - though different methods for each would be OK) compound polygon with edges consisting of line segments, arcs and/or elliptical...
  34. J

    Algorithm Analysis (Big Theta)

    Homework Statement Here is a pastebin link to my question, it contains an algorithm, my trace of the algorithm, and my question.Homework Equations I am interested in the theta notation for the runtime of an algorithm The Attempt at a Solution Here is the link http://mathb.in/1202 My thoughts...
  35. J

    Quantum algorithm for order finding

    I am trying to understand the quantum algorithm for order finding, but I can't find the proof anywhere. Can anyone help? Thanks in advance \frac{1}{√r} Ʃ^{r-1}_{s=0} e^{2πisk/r} |μ_{s}> = |x^{k} mod N>
  36. S

    Loop Invariant in Analysis of Algorithm

    I can't generally map Loop Invariant method for proving the correctness of an Algorithm. Take the case of an Insertion Sort http://csnx.groups.allonline.in/pool/Introduction%20to%20Algorithms-Cormen%20Solution.pdf in the above link, at the page 2-3, they have proved the correctness of...
  37. R

    System Parameter Estimation with Projection Algorithm

    I am recently trying to identify system parameters with projection algorithm, but faced a problem, and the dynamic model is the following: \ddot{y}(t)+a\cdot\dot{y}(t)=b\cdot e(t) The true value of a is 2.8, b is 0.1. While inputing volt e(t)=12sin(2\pi t)+5sin(2t), I can get a good...
  38. S

    Why isn't my algorithm code working?

    I have to write a program validating credit card numbers using Luhn's algorithm. I am having trouble getting my last function to work. For a credit card number I'm supposed to double every second digit from right to left, and sum them (note double digits, like 10=1+0), and then add the rest of...
  39. E

    Relationship between line search and least mean square algorithm

    Hi there, I am going thru basics of optimization and I see line search being used in many sophisticated optimization algorithms. From what I understand, it works by taking the derivative at a point and moves in a direction that minimizes the function. I have earlier experience using...
  40. M

    Number Theory Euclidean Algorithm

    Homework Statement Suppose that u, v ∈ Z and (u,v) = 1. If u | n and v | n, show that uv | n. Show that this is false if (u,v) ≠ 1. Homework Equations a | b if b=ac [b]3. The Attempt at a Solution I understand this putting in numbers for u,v, and n but I don't know how to...
  41. A

    How to write the algorithm? I have figured out a method to find the inverse.

    How to write the algorithm? I figured out a method to find the inverse. The assignment is making use of the property of triangular matrices to find the inverse of a matrix \displaystyle A. The inverse of a triangular matrix(Upper/ Lower) is also triangular(Upper/ Lower) and is easy to find...
  42. K

    Algorithm running time discrepencies

    Twice I have had to calculate the speed of algorithms depending on input size. The first time I was working in MATLAB(which is based on C) and was timing the difference in time to perform matrix operations on the identity matrix in standard storage and in sparse storage, as I grew the matrix...
  43. R

    Fraction reduction, euclid's algorithm

    Homework Statement reduce the fraction \frac{943578}{1978935} to its lowest terms using Euclid's algorithm The Attempt at a Solution I start with finding the gcd of these two numbers using E.algorithm 1978935=943578*2+91779 942578=91779*10+25788 91779=25788*3+14415 25788=14415*1+11373...
  44. A

    Algorithm for a tensorial Karhunen-Loeve Transformation?

    Does anyone happen to know a good algorithm for a numerical Karhunen-Loeve transformation for tensors? Specifically, I'm trying to solve for the eigentensors of a correlation bitensor, along the lines of \int_{-\infty}^{\infty} d^4x' \, C_{abc'd'}(x,x') \phi^{c'd'}(x') = \lambda \phi_{ab}(x)...
  45. A

    MHB Theta(n^2) running time of Quicksort Algorithm

    I am trying to prove the following scenario of Quicksort has a running time of Theta(n^2). Initially, we only have arrays of size n, where n = ij. The idea is that at every partition step of Quicksort, you end up with two sub-arrays where one is of size i and the other is of size i(j-1). i in...
  46. C

    Apply "Swinging Door" Algorithm to Irradiance Time Series

    How to face a data processig to apply "swinging door algorithm" to a irradiance time Homework Statement I would like to obtain the relevant (irradiance change, time increment) pairs from a irradiance time serie that I have in Excel and Origin. One way to do that is making "swinging door"...
  47. srfriggen

    Use of Division Algorithm word problem

    Homework Statement In Florida, the fourth and fifth digits from the end of a driver's license number give the year of birth. The last three digits for a male with birth month m and date b are represented by 40(m-1)+b. Determine the dates of birth of people who have last five digits 42218 and...
  48. B

    Lyndon words: Duval's algorithm and its time complexity

    Hi everyone, Duval' algorithm computes all the k-ary Lyndon words up to any length, say n. See here for a brief introduction to Lyndon words and note the section Generation. http://en.wikipedia.org/wiki/Lyndon_word The article claims that "the sequence of all Lyndon words of length at most...
  49. M

    Division Algorithm: Proving 24 Does Not Divide a² - 1

    1. My difficulty is to show that if a is an integer such that 2 does not divide a and 3 does not divide a then 24 does not divide a squared minus 1 2.Is there any equation which helps? 3. My idea is that it has to be an integer such that 6 does not divide a...therefore i have to show...
  50. M

    General question about crossover operator for a genetic algorithm

    Hey guys, this is my first time working on a genetic algorithm. It seems to me that the algorithm is primarily defined by how you choose to define your crossover operator and fitness function. Let's say the crossover takes two parents and produces one child. Is it necessary/good/bad/etc that the...
Back
Top