Can Two Elevators with Different Periods Meet on the Same Floor?

  • Context: Undergrad 
  • Thread starter Thread starter apacz
  • Start date Start date
  • Tags Tags
    Gcd
Click For Summary
SUMMARY

This discussion addresses the mathematical problem of determining the first common floor where two elevators, defined by their starting floors and stopping periods, meet. The elevators are represented as (a1, r1) and (a2, r2), where 'a' is the starting floor and 'r' is the period. The key insight is that a common floor exists if the greatest common divisor (GCD) of the periods divides the absolute difference of the starting floors. The Extended Euclidean Algorithm is suggested as a method to find integer solutions to the equations derived from the elevator conditions.

PREREQUISITES
  • Understanding of Diophantine equations
  • Familiarity with the Extended Euclidean Algorithm
  • Knowledge of number theory concepts, specifically GCD
  • Basic algebra skills for solving linear equations
NEXT STEPS
  • Study the properties of Diophantine equations in detail
  • Learn how to apply the Extended Euclidean Algorithm to solve linear equations
  • Research GCD and its applications in number theory
  • Explore practical examples of elevator scheduling problems in operations research
USEFUL FOR

Mathematicians, computer scientists, and engineers interested in algorithm design, particularly those working on scheduling algorithms or optimization problems involving periodic systems.

apacz
Messages
1
Reaction score
0
Hello everyone,
I have such problem: there are 2 elevators which go only upwards, and stop on only particular floors, each elevator is described by 2 numbers: (a,r) where a is a number of floor on which the elevator starts and r is a number which is a period of elevator's stops. For example, if we have elevator a=1, r=3 then it stops on that floors: 1,4,7,10,13,16,19 and so on and so forth. And now my question: how to find the first common floor of those 2 elevators and the period of repeating common floors. I know that two elevators (first elevator (a1,r1), second elevator (a2,r2) ) have common floor when GCD(r1,r2)|p where p is |a1-a2| so it should be something like that:
a1+x*r1 = a2+y*r2
x*r1 + (-y)*r2 = a2 - a1
I don't know what to do know and if it is a good way of solving that problem, I though about The Extended Euclidean Algorithm which says:
ax+by=gcd(a,b)

So we could try to do something like that:
(a2-a1)/gcd(r1,r2)=k
a2-a1=gcd(r1,r2)*k
x*r1 + (-y)*r2 = gcd(r1,r2)*k
But... afair a,b in extended euclidean algorithm must be integers so we can't divide it by k.
Doest anyone know how to solve it ? Maybe there is some other way to solve it?

Regards,
apacz
 
Physics news on Phys.org

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K