Keep It Simple, Stupid PerlMonks

### Comment on

 Need Help??

To store the data in a more compact form, it's necessary to understand the data so you can look for more compact representations of the information it represents. And for now, that isn't clear (to me).

I set up a small set of input ranges--of both the normal--\$start <= \$end type; and the inverted \$end < \$start type; and then tried to make sense of the numbers returned by num_ranges_containing(). And I cannot.

I input these ranges:

```my @ranges = (
[ 0, 5 ], [ 1, 6 ], [ 2, 7 ], [ 3, 8 ], [ 4, 9 ], [ 5, 10 ],
[ 5, 0 ], [ 6, 1 ], [ 7, 2 ], [ 8, 3 ], [ 9, 4 ], [ 10, 5 ],
);

And then asked for the counts containing the ranges: [0,3], [1,4], ...., [7,10], and as the returns didn't add up, I did a simple plot:

```c:\test>861961
------                0.. 5
------               1.. 6
------              2.. 7
------             3.. 8
------            4.. 9
------           5..10
-----           5.. 0
-      ----           6.. 1
--      ---           7.. 2
---      --           8.. 3
----      -           9.. 4
-----                10.. 5

----                  0.. 3     range: 0 .. 3 is contained by 1 ranges
----                 1.. 4     range: 1 .. 4 is contained by 4 ranges
----                2.. 5     range: 2 .. 5 is contained by 4 ranges
----               3.. 6     range: 3 .. 6 is contained by 3 ranges
----              4.. 7     range: 4 .. 7 is contained by 3 ranges
----             5.. 8     range: 5 .. 8 is contained by 3 ranges
----            6.. 9     range: 6 .. 9 is contained by 2 ranges
----           7..10     range: 7 .. 10 is contained by 1 range
+s

Looking at just a couple:

• [0,3] returns 1;

But to my eyes, it appears to be contained by at least: the first, and last two input ranges?

• [1,4] returns 4;

But only appears to be contained by the first two, and last input ranges?

How am I misinterpreting the data?

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Serializing a large object by BrowserUk
in thread Serializing a large object by daverave

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

• Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
• Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
• Read Where should I post X? if you're not absolutely sure you're posting in the right place.
• Posts may use any of the Perl Monks Approved HTML tags:
a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
• You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
 For: Use: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?

Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2018-05-22 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
World peace can best be achieved by:

Results (166 votes). Check out past polls.

Notices?