comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Some advice required [OT]
Date: Tue, 28 Dec 2021 22:20:00 -0600	[thread overview]
Message-ID: <sqgnli$sul$2@franka.jacob-sparre.dk> (raw)
In-Reply-To: fefmsgl4cpearv10nkdm07kirrn5gete3e@4ax.com

"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message 
news:fefmsgl4cpearv10nkdm07kirrn5gete3e@4ax.com...
> On Mon, 27 Dec 2021 23:48:31 -0800 (PST), Laurent <lutgenl@icloud.com>
> declaimed the following:
>
>>
>>The requirements are one strain of a certain microorganism/patient
>>The most resistant one or if they have different profiles
>>
>>SRS vs RRS => last one, more Rs
>>
>>SRS vs RSR = both, different profiles
>>
>
> Which is still inconclusive (at least as I view it) -- your second
> example ALSO fits the "last one, more Rs" constraint. You haven't to 
> define
> how the first doesn't qualify as "different profiles". Both examples are
> "1R, 2S" vs "2R, 1S".

Let me try. I think he is saying that when one compares two profiles, one 
compares each position with the relation I < S < R. Then, if you get the 
same order for every position (either >= or <=), then (and only then), the 
profile with more R's is the one you keep (or more S's if there are the same 
number of R's). If you don't get the same order for each, then you keep 
both.

So, for any pair of profiles, you can get a result of "<", ">", or 
incomparable. It should be easy enough to write a function to determine this 
result.

The problem I see is that I don't think there is any way to do this across 
all of the data short of comparing all of the pairs The compare function 
needs to be a "strict weak ordering" in order that sorting and the like be 
meaningful between data sets. The issue here is that "incomparable" gets in 
the way of having A > C being true for any B such that A > B and B > C.

OTOH, I wouldn't worry about that unless the data set is large. Computers 
are fast these days, and brute force approaches are much easier to figure 
out.

So I suggest the OP write a function to compare two sets of data; if the 
result is that the sets are comparable, eliminate the set that is less 
interesting. Then apply that function to every pair in the data until there 
are no further eliminations. (Probably one would "eliminate" a set by 
marking that it is less interesting that some other set, as opposed to 
deleting it outright. I'd probably just use a spreadsheet cell pointing to 
the more interesting set.)

If it was me, I'd do that in Ada first, to get the algorithm right. Then 
translate it into whatever other languages (maybe even spreadsheet 
formulas).

                               Randy.


  reply	other threads:[~2021-12-29  4:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27  9:21 Some advice required [OT] Laurent
2021-12-27 11:16 ` Niklas Holsti
2021-12-27 12:29   ` Laurent
2021-12-27 13:14     ` Ben Bacarisse
2021-12-27 18:24       ` Laurent
2021-12-27 19:51         ` Dennis Lee Bieber
2021-12-27 20:49         ` Ben Bacarisse
2021-12-27 22:09           ` Laurent
2021-12-28  0:29             ` Ben Bacarisse
2021-12-28  7:48               ` Laurent
2021-12-28  9:05                 ` Laurent
2021-12-28 12:54                   ` Laurent
2021-12-28 13:57                     ` Ben Bacarisse
2021-12-28 18:19                       ` Laurent
2021-12-28 13:43                 ` Ben Bacarisse
2021-12-28 16:49                 ` Dennis Lee Bieber
2021-12-29  4:20                   ` Randy Brukardt [this message]
2021-12-27 17:41     ` Dennis Lee Bieber
2021-12-27 18:56       ` Niklas Holsti
2021-12-27 19:44         ` Laurent
2021-12-28  2:10     ` Randy Brukardt
2021-12-28  6:02       ` Laurent
2021-12-29  3:58         ` Randy Brukardt
2021-12-27 17:18 ` Simon Wright
2021-12-27 18:30   ` Laurent
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox