Numerical series density - page 15

 
I'm telling you. A smaller delta will show a higher density.
You will be taking deltas in ascending order. And you'll have densities from higher to lower
 
Vyacheslav Kornev:
Look, you too can eliminate 65 and 71
Take delta 5
Everything else will be in place

If only 5, we lose 21.

Vyacheslav Kornev:
Or wrong? The task was to find clusters so? Our numbers are only ordinal numbers. Only the delta matters.

You propose a method of solving the problem, which shows a decent result. However, I cannot yet decide which method is better, including accuracy.

Vyacheslav Kornev:
The tightest is 40 and 42

Such a group we do not have ...

 
Vyacheslav Kornev:
I'm telling you. A smaller delta will show a higher density.
You will be taking deltas in ascending order. And you will have densities from higher to lower

The density of a single number in relation to its neighbour, yes, but not of a group...

 
What do you actually want?
The density of a group is greater if there are just more numbers in it
 
I think it's pretty clear. If not. Then write me the criterion for density, what is meant by this value.
 
Vyacheslav Kornev:
I think it's pretty clear. If it's not. Then write me a criterion of density, what to understand by this value.

That's the thing, it's a matter of discussion...

Whether or not you need to consider the ratio of numbers in the group to each other - you just need to look at how many numbers fit in the range of the group. Earlier I gave two methods of calculation - which one is better - I don't know.

 
Can you explain the practical application to me?
 
Vyacheslav Kornev:
Can you explain the practical application to me?

Second paragraph https://www.mql5.com/ru/forum/163871#comment_3938228

 

The script now splits the numbers into groups (areas) and calculates the density for each group.

I think the code can be simplified without losing functionality - suggestions are welcome.

Files:
 
Okay, I got it. I'll tell you what to do. You're just misleading people. You're not looking for density. You're looking for clusters. When we're working with integers.
Row : 1,2,3,4,5,6 is the density reference. 100%
Row 1,2,_,4,5,6 - is less dense.
A more dense row than 1,2,3,4,5,6. Limited to 6, does not exist.