I have the following list:
points = Tuples[Range[0, 1.25, 0.25], 9]
I would like to select only those lists who have the following properties, naming the elements of each lists with slots:
- 1)
#1>0.4
- 2)
#9>#8,#8>#7,#7>#6
- 3)
#1+#2+#3< 1.22
- 4)
#5<#4
- 5)
#4<1.21
- 6)
0.5 (#1 (2.42-#6+#7)+#2(#4+1.21-#6)+#3 (#5+#4))<0.625
- 7)
All #>0
Any suggestions to do this?
UPDATE
As Rashid pointed out, this is terribly slow to solve. If any brilliant lad can think of a way to directly construct such a list, chapeau!
In the spirit of making the code less slow as suggested by Rashid, I have written this code for the first list of lists:
points = Partition[#, 9] &@
Flatten@Tuples[{Tuples[Range[0.25, 0.75, 0.25], 1],
Tuples[Range[0, 0.75, 0.25], 4],
Tuples[Range[0, Pi/3, Pi/12], 4]}];
Please use this code instead of the first. With this code condition 1 is implicitly given. Any other suggestions for building the list is welcomed. I also added some extra conditions to limit the length of this list.
Tuples
at0.25
and the third atPi/12
. $\endgroup$