Count amount of number combinations

Hi everyone!

I want to ask about number pairs counting.

In this screenshot you can see two lists of numbers as input and the list of number combinations as output.
I need to count the number of similar pairs (equal brunches) at the last list (for example there you can see in brunches {3} and {4} pairs of 5 and 100 so they are same).

Do somebody have any ideas how to make this?

If you want better help post a file. Did you try the set component? Not sure if it works without modification in pairs of data.

Set would work if the combinations are turned into a single string, but could have different results depending on whether (5, 100) and (100, 5) are considered the same or not.

This could also be approached through formulas - it’s a part of math that falls under Combinations

1 Like

Hi,

this might be one of the possible solutions…

Count Amount_RE.gh (13.0 KB)

…or with one sorting before everything in case @jokamm mentioned

1 Like

Many thanks, Jakinta!

Now it’s clear for me.
Seems I have to digg more into combinations math.

If I explain my task more detailed, I also need to find situations, where element (-1,60,L) is decided similar to (1,60,R), but not to (-1,60,R). Such as on the screenshot, there you can see two details, where blue one is the mirrored red one. But in reality you can only turn the element by 180 degrees, not flip. So the detail with height = 60 and angle =1 on the right side will be same as (60, -1) on the left.

Thank you in advance for your answer!

Count Amount_RE_01.gh (12.3 KB)

Hi,

your task is not clear from the attached file. You should provide file with internalised geometry

Sorry I wasn’t clear enough.
Here I made more complete definition.
Test_001.gh (657.2 KB)

Here is more correct explanation of counting rules (if I understood correctly):
(h,+a,+1)=(h,-a,-1);
(h,+a,-1)=(h,-a,+1);
(h,+a,+1)≠(h,+a,-1);
(h,+a,+1)≠(h,-a,+1)

Where:
H - fixture height
A - angle
1 and -1 - side