Re: question about the 'loves' algorithm



The Qurqirish Dragon wrote:
Robert Israel wrote:

In article <451bd827$1@cs1>, Jeroen <no_mail@xxxxxxxxx> wrote:

The Qurqirish Dragon wrote:

Jeroen wrote:


Hi all,

I have a somewhat practical and maybe silly question about the 'loves'
algorithm. Let me explain first what the algorithm is. Suppose your name
is John, and you like a girl named Jane. You can calculate the chance
that a relationship would work (but don't take the outcome too
seriously). For each character in the word 'loves', count the total
number of occurences in both names 'John' and 'Jane' (you can also take
full names...). Then start adding subsequent digits until a 2 digit
number is obtained, which is the outcome. So we have:

John L O V E S Jane

start 0 1 0 1 0 (only 1 'o' and 1 'e' in both names)
step 1 1 1 1 1
step 2 2 2 2
step 3 4 4 -> 44 % success rate for a relationship


For some combinations of names, the number of digits seems to grow
infinitely. My own name with that of a girl I happen to like grows to
more than 1e6 digits in 66 iterations.

The question is: is there some way of determing that the number of
digits will grow infinitely, based on the starting digits? Or will every
combination of names eventually break down to a 2 digit number? I have
no idea :-)

Jeroen


Some clarification is needed:
Let's assume the two people are "Lovey" and "Dovey":

start: 1 2 2 2 0
step 1: 3 4 4 2
step 2: 7 8 6

is step 3:
1 5 1 4
15 14
1 6 4 (carry the 1 from the 14 into the 15)

or something else?
The way sums larger than 9 are handled will definitely have an impact
on the result (if it ever terminates!)


Each step only handles single digits of the previous result (each
sum-results must be written down as separate digits if > 9), so it is

from step 2:

7 8 6
1 5 1 4
6 6 5
1 2 1 1
3 3 2
6 5

Jeroen

OK, suppose at some step your result consists of n 9's with
n > 3.
Next step is 2n-2 digits, consisting of n-1 repetitions of 1 8.
Next step is 2n-3 9's. Since 2n-3 > n, it grows indefinitely.


Continuing in a similar thought:
what if there is a set of n 8's (minimum n to be determined)?
next step is 2n-2 digits, being n-1 pairs of 1 6
next is 2n-3 7's.
next is 4n-8 digits, being 2n-4 pairs of 1 4
next is 4n-9 5's
next is 8n-20 digits, being 4n-10 pairs of 1 0
next is 8n-21 1's
next is 8n-22 2's
next is 8n-23 4's
next is 8n-24 8's
if 8n-24>n, then the growth continues forever, so n must be greater
than 3.

For a string of 7's, looking at the progression of 8 8 8 8, we see five
7's at the second step, so we only need to explicitly test 7 7 7 7, and
7 7 7. After seven iterations, this becomes 8 8 8 8, and so it grows
indefinitely.
For 7 7 7 we have:
7 7 7
1 4 1 4
5 5 5
1 0 1 0
1 1 1
2 2
and it terminates.

For n 6's (n to be determined), we have:
first step: 2n-2 digits, being n-1 pairs of 1 2
next step is 2n-3 3's
next step is 2n-4 6's

if n=4, then this is cyclic:
6 6 6 6
1 2 1 2 1 2
3 3 3 3 3
6 6 6 6

if n>4, it grows indefinitely.

for 5's, after five iterations, n 5's becomes 2n-6 8's. If 2n-6>=4
(which means n>=5) this grows indefinitely by the 8's case.

for 4's, after one iteration we have n-1 8's, so n>=5 causes the growth
by the 8's case.

for 3's, after one iteration we have n-1 6's, so n=5 is cyclic and n>5
causes growth by the 6's case.

for 2's, after two iterations we have n-2 8's, so n>=6 causes growth by
the 8's case.

Finally, for 1's, after 3 iterations, we have n-3 8's, so n>=7 causes
growth by the 8's case.

Other situations I leave to others who have even more time than me on
their hands.


Thanks guys, for the insight :-)
.



Relevant Pages

  • "Algorithmic Randomness, Quantum Physics, and Incompleteness"
    ... all finite sequences are to be found infinitely often and ... different members of the infinite set of random numbers. ... Just using random numbers with initial digits 1 thru 9, ... it generated by a shorter input algorithm than the length ...
    (sci.logic)
  • Re: BigNum -- Floating Point
    ... > It means the memory required for representing a number is just ... write an RSA algorithm, for example. ... interest might be something like pi...in base N...to M digits. ... >> wouldn't the gcd() itself need to be able to handle bigints? ...
    (comp.programming)
  • Re: BCD List to HEX List
    ... nibbles, shifting, and adding, Those are pretty simple, so I asked ... algorithm what the algorithm is intended to achieve ... ... input was a list of decimal digits. ... was to go from BCD to a normal binary integer, ...
    (comp.lang.python)
  • Re: BCD List to HEX List
    ... nibbles, shifting, and adding, Those are pretty simple, so I asked ... algorithm what the algorithm is intended to achieve ... ... that he had lists of digits rather than an integer datatype. ... input was a list of decimal digits. ...
    (comp.lang.python)
  • Re: singleton vs static
    ... it broadcasts the digits to Martians... ... this might be an algorithm that returns n ... All you need is sufficient analysis to be able ... test involving one time through the loop is sufficient to conclude that the ...
    (comp.object)