Finding N / log(2) and M / log(3) very close together

  • Context: Undergrad 
  • Thread starter Thread starter Swamp Thing
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around finding pairs of integers M and N such that the absolute difference between M/log(2) and N/log(3) is less than a specified small value δ. Participants explore the efficiency of algorithms for this problem, the implications of reducing δ, and the mathematical relationships involved.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant asks for an efficient algorithm to find pairs of M and N satisfying the condition |M/log(2) - N/log(3)| < δ.
  • Another participant suggests that the best approximation occurs when M/log(2) = N/log(3), leading to a specific ratio M/N = log(2)/log(3).
  • A participant presents a specific case using N and M values to demonstrate a consistent relationship, questioning the clarity of the original problem.
  • There is a discussion about the definition of "efficient" and the implications of different bases on the pairs of M and N.
  • Some participants express uncertainty about the behavior of ε as N increases, with one noting that it does not necessarily approach zero in all cases.
  • Another participant mentions the determinant of a matrix related to the logs and suggests that there may be a more sophisticated algorithm for the problem.
  • One participant references a solution from Dirichlet's work and expresses surprise at the complexity of the problem.
  • There are inquiries about using Mathematica functions, specifically LatticeReduce, to find integer pairs that approximate the ratios of logarithms.
  • A participant shares their experience with LatticeReduce and seeks clarification on how to extend their findings to include additional logarithmic terms.

Areas of Agreement / Disagreement

Participants express various viewpoints on the problem, with no consensus reached on the most efficient approach or the implications of their findings. Some participants agree on the mathematical relationships, while others challenge the assumptions and methods proposed.

Contextual Notes

The discussion includes unresolved mathematical steps and varying definitions of efficiency. The complexity of the problem evolves from initial simple approximations to considerations of lattice structures and integer solutions.

Swamp Thing
Insights Author
Messages
1,047
Reaction score
786
What would be an efficient algorithm for finding pairs of M and N such that ##| M/log(2) - N/log(3) |< \delta## , for some given small ##\delta## ?

Also, such pairs would obviously become scarcer as we reduce ##\delta##, but how does it go quantitatively?
 
Physics news on Phys.org
Where are ##M,N## from? How do you define "efficient"? Which computation model do you use?

The best approximation is ##\dfrac{M}{\log 2}=\dfrac{N}{\log 3}## or ##\dfrac{M}{N}=\dfrac{\log 2}{\log 3}\approx 0,6309297535714574370995271143427\ldots##

You can choose now ##(M/N)\in \left\{\dfrac{6}{10},\dfrac{63}{100},\dfrac{631}{1000},\dfrac{6309}{10000},\ldots\right\}## which gets as small as you like.
 
Last edited:
  • Like
Likes   Reactions: Swamp Thing, pbuk, topsquark and 1 other person
That's not actually obvious to me @fresh_42 . In fact for ##|2/9M -N|## taking ##N=22...2## ##n## twos, and ##M=10^n## yields ##|2/9M -N|=2/9## for all ##n##
 
  • Informative
Likes   Reactions: FactChecker
Office_Shredder said:
That's not actually obvious to me @fresh_42 . In fact for ##|2/9M -N|## taking ##N=22...2## ##n## twos, and ##M=10^n## yields ##|2/9M -N|=2/9## for all ##n##
It has been open and unanswered the entire day and I didn't know whether I should solve it, which would have been against the rules, ask for clarification, which I did, expecting a dialogue with the OP, or use a few scribblings with ##\dfrac{M}{\log 2}=\dfrac{N}{\log 3}+\varepsilon .##

\begin{align*}
\left|\dfrac{M}{\log 2}-\dfrac{N}{\log 3}\right|&=\varepsilon \\[6pt]
\left|M \log 3 - N \log 2\right|&=\varepsilon \cdot \log 2\cdot \log 3\\[6pt]
\left|\dfrac{M}{N}-\dfrac{\log 2}{\log 3}\right|&=\dfrac{\varepsilon \cdot \log 2 }{N}
\end{align*}
The approximation of ##\dfrac{M}{N}## by ##0,6309297535714574370995271143427\ldots## makes ##\varepsilon \cdot \log 2 ## arbitrary small for large enough ##N##.

Did I make a mistake?
 
I think so. Maybe there's some special property of log that makes that happen to be true, but the right hand side only goes to zero because N does. If you try to do that procedure with ##2/9## (just picking something easier to compute) at least I found ##\epsilon## to not go to zero as N went to infinity
 
fresh_42 said:
You can choose now ##(M/N)\in \left\{\dfrac{6}{10},\dfrac{63}{100},\dfrac{631}{1000},\dfrac{6309}{10000},\ldots\right\}## which gets as small as you like.
This may be a silly question, but can we be sure there isn't one between ##{\dfrac{631}{1000}}## and ##{\dfrac{6309}{10000}}## ? This list is based on base 10, but other number bases could give different lists?

How do you define "efficient"?
Loosely, I guess. :smile: But I'd like to catch all of the pairs that exist up to a given size of M and N.

I may have posed the question in a non-optimal way, so here is the motivation: We have impulse trains with periods 2 Pi / Log(2) and 2 Pi / Log(3). How can we locate all instances when a pair of pulses, one from each series, gets closer than a given delta?
 
Office_Shredder said:
I think so. Maybe there's some special property of log that makes that happen to be true, but the right hand side only goes to zero because N does. If you try to do that procedure with ##2/9## (just picking something easier to compute) at least I found ##\epsilon## to not go to zero as N went to infinity
You are right. I must be more careful with ##N## such that it doesn't cancel or lead to a lower bound of ##\delta ##.
 
Last edited:
Yep, it is officially not as trivial as I thought or even trivial at all. We are actually looking for integer values that make the determinant ##\left\| \begin{pmatrix}\log 3 &N \\ \log 2 &M \end{pmatrix}\right\|## or the cell of the corresponding lattice arbitrary small.

I am sure that there is a fancy algorithm for that problem.

Edit: I have found out that there is a solution: Dirichlet 1842 (p.9ff)
https://sites.math.washington.edu/~rothvoss/lecturenotes/IntOpt-and-Lattices.pdf

What a day. From ##O(1)## in the morning to NP-hard at night. It is especially embarrassing since I am 90% sure that I recorded verbal exams about the LLL algorithm many, many years ago.
 
Last edited:
  • Like
  • Informative
Likes   Reactions: FactChecker and Swamp Thing
Thanks... I am trying to understand the Roth-Voss PDF.

After searching for "Mathematica, lattice" I learned that you can use for example, Rationalize[ Log[2] / Log[3], 0.00001] to find fractions that approximate the ratio to within the given delta.

Now, I would also like to find m1 Log[2], m2 Log[3] and m3 Log[5] close together within a given delta. (And so on to include Log[6], Log[7] etc) . Mathematica has a LatticeReduce function. I don't understand it fully, but I'm hoping it can be used to find such points. Can LatticeReduce or some other Mathematica function do this?
 
  • #10
I looked at some examples of LatticeReduce and did some trial and error. Finally I could use it for Log[2] and Log[3]:
Code:
v = {2 Pi/ Log[2], 2 Pi / Log[3]};
big = Round[10^9 v];
a = {{1, 0, big[[1]]}, {0, 1, big[[2]]}};
b = LatticeReduce[a];{N[b[[1, 1]] 2 Pi /Log[2], 12], N[b[[1, 2]] 2 Pi / Log[3], 12]}
{N[b[[2, 1]] 2 Pi /Log[2], 12], N[b[[2, 2]] 2 Pi /Log[3], 12]}

Output:
{288865.441279, -288865.441219}
{430284.142425, -430284.142515}
So b11, b12 gives me one pair of M, N and b21, b22 gives another pair.

But now when I try it with three logs, I can't figure out how to use the LatticeReduced "b" to get my M1, M2, M3.
I suspect that I have to try multiplying two (or three?) elements of b by each Log thing, but which ones?
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 29 ·
Replies
29
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K