Algorithm Definition and 651 Threads

  1. 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...
  2. C

    Greedy Algorithm & Optimal Coin Change

    [SIZE="1"]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...
  3. 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!
  4. S

    Euclidean Algorithm: Understanding Division

    http://img82.imageshack.us/img82/4458/divisonfx9.jpg
  5. 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...
  6. T

    Understanding Polynomial Time Complexity

    can sombody pls explain to me what does exponential time algorithm means?? thanx
  7. 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
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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 =...
  13. 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.
  14. P

    How Does Shor's Algorithm Factor Integers Effectively?

    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...
  15. 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...
  16. 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
  17. 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 ? :)
  18. 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...
  19. 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.
  20. 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...
  21. 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...
  22. 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...
  23. 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...
  24. 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...
  25. 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...
  26. 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...
  27. 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...
  28. 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...
  29. 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...
  30. 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...
  31. A

    A thread for learning RSA algorithm

    Hai friends I am aravind,doing post graduate in computer science .In this thread I explain about the maths behind RSA algorithm in a simple way.I think this thread is useful for beginners who are interested in learning RSA algorithm.If anyone interested in this thread give reply.
  32. Loren Booda

    Does Deutsch's Algorithm Reveal Insights Into Prime Numbers?

    Does Deutsch's quantum algorithm provide any profound classical insight into the density of primes?
  33. H

    Finding K-Byte Substrings in Two Long Strings

    I have two very long strings of length s and t. I want to find every k-byte substring that occurs in both of them. What good ways are there to do that? My current algorithm is to store each k-byte substring of the first in a hash table, then look up every k-byte substring of the second. A...
  34. M

    Generate Permutations from Combinations Algorithm

    Does an algorithm exist for generating a particular permutation of a combination? You just input the combination and the position of the permutation and it outputs the permutation.
  35. Z

    How can the Metropolis-Hastings algorithm help simulate a Normal Distribution?

    I'm having trouble understanding how to find an expression for \pi(x) and \pi(y) in the relation: \alpha \left( {x,y} \right) = \min \left( {1,\frac{{\pi \left( y \right)q\left( {y,x} \right)}}{{\pi \left( x \right)q\left( {x,y} \right)}}} \right) For example, If I want to simulate Normal...
  36. G

    A question about graph algorithm

    Suppose there are 10 nodes in a graph, I need to generate edges between nodes, but there are two conditions to be satisfied: 1) each node can have maximize of two edges. 2) no loop in the graph. The question is how to run a program which gives an algorithm to generate such a graph randomly...
  37. S

    Proving Algorithm for Searching Sorted Array

    I have to come up with an algorithm to search a sorted array. Here it is: def binarySearch(inputArray, match): x = -1 start = 0 end = len(inputArray) - 1 while not start == end: midPt = (start + end) / 2 if match < inputArray[midPt]: end = midPt - 1...
  38. W

    What is the Best Way to Determine x Given y in a Sine Wave Algorithm?

    Hi, This maths stuff is tstarting to hurt my head! :p Ok, I want to use a sine wave to make objects appear at an increasing rate and then a decreasing rate. e.g. where: y=sin(x) y = interval before next object appears so in Maple that'd be: plot(sin(x)+1,x=Pi/2..Pi+(Pi/2)); Now I...
  39. F

    What is the loop invariant for proving the LCM algorithm?

    algorithm to prove lcm: a:=m b:=n while a != b if a < b a:= a + m else b:= b + n //postcondition: a is the lcm(m,n) what's the loop invariant?I thought it is(not sure): lcm(ak, bk) = lcm(ak/m, bk/n) *lcm(m,n) I am not sure and also impossible to prove my loop invariant...
  40. C

    An Algorithm to find a Prime Decompisition

    Hello all. I know there is a stupidly easy algorithm to find the prime decompision of a number (i.e. 2*2*2*3*5 is the p.d. of 120) but I can't for the life of me remember it. I need to do this operation on incredibly large numbers (~500 digits) so the naieve way of just starting at 2 and...
  41. N

    Find Area of Intersecting Planes - New Algorithm?

    hello grp... :smile: is there any algorithm of findin the total area of an intersecting plane. i have tried with set theory if a n b r two planes, area(a)+Area(b)-Area(a intersection b) but it takes such a long computation when u go on adding planes to the existing ones. I want to have...
  42. S

    How does the prime number algorithm determine if a number is prime or not?

    When trying to determine whether a number is prime or not, the following algorithm is often used: Test all numbers up to [sqrt[n]] ([x] is the ceiling of x) to see if any divide evenly into n. If any do, the number is not prime. My question is, why do you only have to test up to [sqrt[n]]...
  43. E

    Algorithm to find the train's location and velocity?

    :confused: I'm a silent viewer of this forum, and I came across a question I don't seem to manage...: A train is traveling along the Z axis (infinite on both sides). You have no information as of the train's direction or speed. At each time unit the train lends on a number. At each time unit...
  44. F

    What is the difference between assignment and comparison in VBScript?

    hello, i want to make a linear program which has such this conditional: if the inputs have 2 variables (ex. x & y) and make equations (ex. 2x + 3y <= 23, 5x + y <= 12) then both equation will shown in graphic. but if the inputs have more than 2 variables (ex. x, y & z) and have some...
  45. PFanalog57

    Uncovering the Universal Algorithm

    Here is the definition of "algorithm": http://en.wikipedia.org/wiki/Algorithm DNA is an algorithm, a finite set of instructions, which can construct a carbon based life form. The life form physically contains the DNA and the DNA contains the life form in an "abstract" sense. At a...
  46. C

    Division Algorithm: Find q & r for a=-5286 and b=19

    If I have to find the quotient q and the remainder r and: a = -5286 b = 19 How do I go about writing down the steps for this algorithm? I know what the answer will be, but I need to be able to use the division algorithm to prove my answer. Like I know if: b > 0 and a < 0 (which in this...
  47. W

    Graph Theory: Dijkstra's Algorithm

    Hello, Does anyone know of an online resource which explains Dijkstra's Algorithm both in tabular form and graphical form? My text does an incredibly poor job explaining this algorithm. I sort of understand it graphically. But I have absolutely no idea what is going on when it comes to...
  48. A

    Understanding the Euclidean Algorithm: Solving for Relatively Prime Numbers

    I am little confused on this issue, actually the thing that is confusing me is my book. We all know the formula m=qn+r and 0<r<n In the formula we go until r=0, then you will know relativley prime. When given a problem, for example, (862,347) we have m=862 while n=347 so we have the...
  49. radagast

    How Can We Automate Matrix Inversion for Matrices Near the Identity?

    Anybody know of a link to a page that describes an algorithm for matrix inversion. My old linear algebra book describes a 'by hand' method, but it's unsuitable for automating.
  50. A

    Algorithm of the numerical decision of stochastic Shrodinger equation.

    Prompt please where it is possible to find algorithm of the numerical decision of stochastic Shrodinger equation with casual potential having zero average and delta – correlated in space and time? The equation: i*a*dF/dt b*nabla*F-U*F=0 where i - imaginary unit, d/dt - partial...
Back
Top