What are the integer solutions to $\frac{\frac{q-\lambda}{L} - \mu - p}{P}$ for each $\{p,q\}$?

44 Views Asked by At

(Please help me to rename the question title, if required. My background is engineering.).

Given 2 positive integers $P$ and $L$, I have 4 non-negative integer variables $p,q,\lambda$ and $\mu$, whose values can be: $$\begin{align} p &\in [0,P-1] \\ q &\in [0,LP-1] \\ \lambda &\in [0,L-1] \\ \mu &\in [0,P-1] \end{align}$$

I am interested in knowing when both of the following 2 conditions are met (simultaneously):

  1. $\frac{q-\lambda}{L}$ is an integer.
  2. $\frac{\frac{q-\lambda}{L} - \mu - p}{P}$ is an integer.

I have reason to believe (by writing a simple computer program) that for each choice of $\{p,q\}$, there is exactly one combination of $\lambda$ and $\mu$ that will satisfy these conditions. If possible, I would like to prove that this is true... and if it is, then derive equations that tell me (as a function of $p$ and $q$) what the values of $\lambda$ and $\mu$ should be.

Many thanks for any help!

3

There are 3 best solutions below

1
On BEST ANSWER

Your choice of $ \lambda $ is forced to be $ q $ mod $ L $. Then $ \mu $ is forced to be $ \left( \cfrac{q-\lambda}{L} - p \right )$ mod $ P $

2
On

For $\frac{q-\lambda}{L}$ to be an integer, we require the remainder on dividing $q-\lambda$ by $L$ to be zero. That is, $$ q- \lambda \cong 0 \pmod{L} \text{,} $$ and expressing $\lambda$ as a function of $q$ and $L$, $$ \lambda \cong q \pmod{L} \text{.} $$ Since $\lambda \in [0,L-1]$ allows $\lambda$ to be any member of a complete residue system modulo $L$, the $\lambda$ this congruence requires is always an available choice.

Let $n = \frac{q-\lambda}{L}$ and recall that $n$ is an integer.

(We don't actually need the following for the next congruence, but if one is implementing in a program, it can be convenient to know that various intermediate expressions do not lead to underflow or overflow. Since $q \in [0,LP-1]$ and $\lambda \in [0,L-1]$, $q - \lambda \in [-L+1, LP-1]$ and is a multiple of $L$, so is actually in $[0,L(P-1)]$. Then $n \in [0,P-1]$.)

We also require $\frac{n - \mu - p}{P}$ is an integer, so $$ n - \mu - p \cong 0 \pmod{P} \text{,} $$ or writing $\mu$ as a function of the other variables, $$ \mu \cong n - p \pmod{P} \text{.} $$ Since $\mu \in [0,P-1]$ allows $\mu$ to be any member of a complete residue system modulo $P$, the $\mu$ this congruence requires is always an available choice.

Summarizing,\begin{align*} \lambda &\cong q \pmod{L} \text{, } \\ \mu &\cong \frac{q - \lambda}{L} - p \pmod{P} \text{.} \end{align*} This can be implemented, for example in Python, as

lambda = q % L
mu = ((q-lambda)/L - p) % P
0
On

You are requiring solutions to the equations

$\lambda=q+nL$ for $n$ an integer and then

$\mu=n-p-mP$ for $m$ an integer.

Consider the first of these. You can subtract as many multiples of $L$ as you need from $q$ until the result is in $[0,L-1].$ If you took $1$ more $L$ you would get a negative answer so you are correct- there's precisely one $\lambda$ satisfying your equations.

Exactly the same reasoning applies to $\mu$ so your conjecture is proved.

In terms of a formula, there is a function int(x) which gives the whole number part of a fraction. With this we have $$\lambda=q-\text{int} (\frac{q}{L})L.$$

You can do the same for $\mu$.

N.B. Some computer languages (perhaps most nowadays) use floor rather than int.