Re: Removing White Space...

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Bob O`Bob (filterbob_at_yahoogroups.com)
Date: 04/10/04


Date: Sat, 10 Apr 2004 08:35:41 -0700

Larry Serflaten wrote:
>
> "Tony Proctor" <tony_proctor@aimtechnology_NOSPAM.com> wrote
> > There are a few variations of the sequence quoted in this thread, e.g.
> >
> > 2, 2, 5, 5, 16, 120
> > 2, 3, 4, 7, 22, 232, 26797
> > 2, 3, 3, 5, 13, 121, 9841, 64570081
> >
> > ..so which is the correct one folks?
>
> The last two I recognise, but I don't remember seeing that top one.
> Perhaps you copied it wrong? In any case, #2 is the best one over all.
> I compared it with the bottom one about the time #2 was posted. For
> about the first 3 terms they were equally performant but after that #2
> was consistantly able to reach higher values than #3.
>
> If you compare them term for term, for the task they were intended,
> you will note that #2's terms are larger from position 3 on. (4 vs 3)
> That means Replace will be replacing larger strings, and as a result,
> do it fewer times for the same level of reduction.

Actually, it doesn't work that way all the time.

I evolved a complex notation a couple of years ago because many times
it just _does not matter_ which of several options are chosen.
(2, 2|3, 3|4, 6|7, 21|22, 231|232) is what I came up with back then,
and none of those substitutions make a difference to where the first
failure occurs:

 2,2,3,6,21 first fails at 461, while 2,3,4,7,22 first fails at ... 461.
Insert 231 _or_ 232, and the first failure is at 53591.

I haven't validated it yet (my test program is too slow) but the next
number on my candidate list is 26796. It seems quite likely that 26797
works the same, or slightly better. If my tester didn't take hours,
I'd start with 26795 (53591/2 rounded down) test and increment, until
the failure points start to go back down.

The sequence with 13 in it may or may not be from one of my old attempts,
but either way it's not as good. The one with 16 could easily be from a
post of mine, but again it turned out not as good. 2,2,5,5,16 is pretty
easy to remember, though :-)

        Bob



Relevant Pages

  • Re: "CF Bike Shatters" - continued
    ... But since the mechanisms of failure are so different, ... disagree - because the mechanisms are different, we /cannot/ compare them. ... A steel bike that must be rugged and tolerate impacts and abrasion on ... frame, you wind up with a frame that's stronger and stiffer, but no ...
    (rec.bicycles.tech)
  • How many degrees of freedom?
    ... Instead of dealing with the failure of a single piece of equipment, we have several pieces of equipment--the failure of any of these ... If I want to determine the significance level of a model of this form, one way is to compare the likelihood of the model with the ... likelihood of a model using a constant value of th, using a likelihood ratio test (LRT). ... We can compare these to each other with the LRT, ...
    (sci.stat.math)
  • Re: Windopes abject failure with NTFS filesystem
    ... >> then that did not cause failure of the FS. ... You deliberately compare ext2 with NTFS, despite the fact that NTFS is ... I've only once or twice heard about that happening to ext3 for reasons ...
    (comp.os.linux.misc)
  • Comparing 2 Unix files but ignoring line numbers
    ... This is a test program. ... I'd like to compare File1 and File2 from above. ...
    (comp.unix.shell)
  • Re: Comparing 2 Unix files but ignoring line numbers
    ... > Is there a command, script, or function in Unix in which one can compare ... > 20 Author: John Doe ... This is a test program. ...
    (comp.unix.shell)