From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,XPRIO autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Some advice required [OT] Date: Tue, 28 Dec 2021 22:20:00 -0600 Organization: JSA Research & Innovation Message-ID: References: <7bede061-4b0f-4029-beb1-1056637e57d6n@googlegroups.com> <49538254-21ed-4fd0-8316-1bccc7d3c635n@googlegroups.com> <87sfue8a0v.fsf@bsb.me.uk> <31332c61-a370-43a5-bbe0-efe338ee6d8fn@googlegroups.com> <87fsqd7oz8.fsf@bsb.me.uk> <87y2456071.fsf@bsb.me.uk> <7f50b560-9d28-4572-a90c-7488fb27582en@googlegroups.com> Injection-Date: Wed, 29 Dec 2021 04:20:02 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="29653"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:63302 List-Id: "Dennis Lee Bieber" wrote in message news:fefmsgl4cpearv10nkdm07kirrn5gete3e@4ax.com... > On Mon, 27 Dec 2021 23:48:31 -0800 (PST), Laurent > 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.