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

  • Thread starter Thread starter apacz
  • Start date Start date
  • Tags Tags
    Gcd
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
I asked online questions about Proposition 2.1.1: The answer I got is the following: I have some questions about the answer I got. When the person answering says: ##1.## Is the map ##\mathfrak{q}\mapsto \mathfrak{q} A _\mathfrak{p}## from ##A\setminus \mathfrak{p}\to A_\mathfrak{p}##? But I don't understand what the author meant for the rest of the sentence in mathematical notation: ##2.## In the next statement where the author says: How is ##A\to...
The following are taken from the two sources, 1) from this online page and the book An Introduction to Module Theory by: Ibrahim Assem, Flavio U. Coelho. In the Abelian Categories chapter in the module theory text on page 157, right after presenting IV.2.21 Definition, the authors states "Image and coimage may or may not exist, but if they do, then they are unique up to isomorphism (because so are kernels and cokernels). Also in the reference url page above, the authors present two...
##\textbf{Exercise 10}:## I came across the following solution online: Questions: 1. When the author states in "that ring (not sure if he is referring to ##R## or ##R/\mathfrak{p}##, but I am guessing the later) ##x_n x_{n+1}=0## for all odd $n$ and ##x_{n+1}## is invertible, so that ##x_n=0##" 2. How does ##x_nx_{n+1}=0## implies that ##x_{n+1}## is invertible and ##x_n=0##. I mean if the quotient ring ##R/\mathfrak{p}## is an integral domain, and ##x_{n+1}## is invertible then...
Back
Top