Algorithm Definition and 725 Threads

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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.
  6. 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?
  7. 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...
  8. 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.
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. 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...
  15. 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...
  16. 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]]...
  17. 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...
  18. 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...
  19. 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...
  20. 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...
  21. 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...
  22. 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...
  23. 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.
  24. 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...
  25. Moni

    Algorithm which is optimal for these geometry problems

    I don't know the optimal result but I gave some hint in that topic. Can anyone tell me the algorithm which is optimal for these geometry problems. http://acm.uva.es/board/viewtopic.php?t=2631
Back
Top