Talk:Range consolidation

From Rosetta Code
Revision as of 10:03, 3 February 2019 by rosettacode>Paddy3118 (More info.)

The nature of these ranges, and thus of the task, is not yet clear

Ranges with bounds b0 and b1 covering all numbers in between doesn't seem to fully clarify or define the exercise, in particular, the intended nature of these ranges. Some of the bounds (or range members ? set members ?) appear to be integers, others appear to be floats or reals. If either of the latter is intended, then "all numbers in between" sounds like a rather large, very possibly even infinite, set.

Clarification ?

Cases in which b0 is higher than b1 are also undefined in the preamble, but required in the test sample. Are we to understand these 'ranges' as unordered sets ? That seems to be suggested in the results shown from the Python code, which discard order without comment, implicitly treating [1 10.5] as equivalent to [10.5 1]

Clarification ? Hout (talk) 06:52, 3 February 2019 (UTC)

Hi Hout, I'll comment here and adjust the wording later today when I have more time.
The ranges are defined by their endpoints and denote ranges of what can be described in int/fp. The ranges are not directional, [1, 2] covers the same range on a number-line as [2, 1].
Yep, a range with different endpoints represents a large number of individual floats, but is defined by its endpoints.
To be able to asily compare outputs it seemed that a sorting should be devised so that all outputs would be similar, but, I wanted to impose no such limitation on inputs, so programs may have to pre-condition/normalize inputs depending on their code.
Pythons pre-normalization is an integral part of its algorithm. (Which I have not yet fully tested}.
My thoughts on automatically testing are to generate random sets of ranges on, say, a grid of x=0.5 then ensure that all points in the range on a grid of x/2. are similarly ex/included by the random input, and consolidated output ranges - or some such.
--Paddy3118 (talk) 10:02, 3 February 2019 (UTC)