Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: union and intersection of ranges

by syphilis (Archbishop)
on Feb 09, 2023 at 00:22 UTC ( [id://11150250]=note: print w/replies, xml ) Need Help??


in reply to union and intersection of ranges

Do they refer to the LENGTH of the intersection being at least half the length of the union?

Yes, I would think that's what they're after. But you could check with "they", if that's allowable and possible.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: union and intersection of ranges
by BillKSmith (Monsignor) on Feb 09, 2023 at 17:07 UTC
    If you assume that 'ranges' are 'sets', the terms 'union' and 'intersection' are well defined. They are both sets. Marshall has given shown how to compute them directly from the definitions. Perhaps your spec intends for you to compare the cardinality of these sets.

    If you assume that 'ranges' are ordered lists, you need LanX's assumptions to make any sense at all. (The calculation is much simpler because it exploits the ordering.)

    Fortunately, both sets of assumptions produce the same results.

    Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11150250]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-03-28 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found