# Talk:Non-transitive dice

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

## Exclude rotations?

If we have S < T, T < U and yet S > U then it follows we
also have T < U, U < S and yet T > S
as well as U < S, S < T and yet U > T - and that will be every single time, for every set, without fail.
Should we not just keep the one that starts numerically smallest? --Pete Lomax (talk) 23:27, 7 September 2020 (UTC)

As an aside, is it always the case that there is only one solution? Or is that just a coincidence? It would be nice to stop searching permutations early. --Chunes (talk) 00:59, 8 September 2020 (UTC)
It is a coincidence of the 1..4 limit. While I didn't search for them, there are at least two triplets of 6 dice with 1..9 faces, as shown at the end of the Phix output. I have also just added two optimisations: First, when checking a set if any k/k+1 fail then I set [k+2..\$] to l ensuring k+1 is incremented next, a 3-fold speedup. Second, I cached the cmpd() results, a 10-fold speedup. So it is now 30 times faster than it was before. --Pete Lomax (talk) 03:05, 8 September 2020 (UTC)
Those are great optimisations, Pete. I'd like to apply them to the Python solution.
On rotations of solutions: I do have somewhere a version with rotations, but I can't remember why I dropped it - I probably flitted over to another "shiny" part of learning about non-transitive dice that caught my attention. The task wording seems to be consistent with the shown results, I think, if not then I'd need to change it.
P.S. I am floored by the maths aspect - reals and then quaternions loosing commutativity in higher dimensions compared to dice with one face/ "ints" and then dice with more faces loosing transitivity?!
--Paddy3118 (talk) 09:52, 8 September 2020 (UTC)
Thanks again, that's a lot of cache hits:
`Out[45]: CacheInfo(hits=2148761, misses=1190, maxsize=None, currsize=1190)`
--Paddy3118 (talk) 10:11, 8 September 2020 (UTC)

### Allow for excluded rotations?

Any rotation of dice from an answer is also an answer. You may compute and show only the rotation with the "lowest sorted face numbers first". In sorting, faces numbers are compared in pairs from left to right. if current pair are the same then the next pair of face numbers are compared until there is a difference or all face numbers compare equal. E.g. A= 2, 3, 5 and B= 3, 3, 4 means A < B. C= 1, 4, 4 compares less-than both A and B due to the first face being 1. Although A, B, C do form a non-transitive list of dice, but if you elect to filter rotations then:
1. Show the rotation with the "smallest" die first, i.e. C, A, B.
2. Prominently state in the output that rotations of results are also solutions.

What do you think? --Paddy3118 (talk) 10:43, 8 September 2020 (UTC)

Sounds fine, though I'd probably say "Any rotation of dice from an answer is also an answer. You may compute and show only one of each such rotation sets, ideally the first when sorted in a natural way, and show the total number of rotations that are also solutions".
Anyway, rotation-squishing added to Phix, along with a newly invented stretch goal. --Pete Lomax (talk) 17:49, 8 September 2020 (UTC)

## java Error message

What's wrong here?

H:\>javac Main.java Main.java:55: error: cannot find symbol

```                           res.add(List.of(cs.get(i), cs.get(j), kl));
^
symbol:   method of(List<Integer>,List<Integer>,List<Integer>)
location: interface List
```

--Walter Pachl 07:04, 11 March 2022 (UTC)

The List.of method was introduced in Java 9 so I suspect you're using an earlier version.
As a possible workaround try replacing that line with:
import java.util.Arrays;
--PureFox (talk) 08:48, 11 March 2022 (UTC)
Thanks. The change worked. BUT I installed Java 9 and I still see
D:\>javac -version
javac 1.8.0_144
and
java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
Where do I get javac 9? --Walter Pachl 09:23, 11 March 2022 (UTC)
Hmm, it looks like your compiler version is out of step with the rest of the JDK. Assuming you're using the Oracle version (rather than Open JDK), I don't think you can still get version 9 but you can get Version 11 if you don't want to move up to the latest Version 17.--PureFox (talk) 09:43, 11 March 2022 (UTC)
D:\>java -version
java version "17.0.2" 2022-01-18 LTS
Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)
D:\>javac -version
javac 17.0.2
So it's way beyond 9 now :-) But in sync and the compile works --Walter Pachl 10:44, 11 March 2022 (UTC)
Yeah, since they started with the 6 monthly releases, the version numbers have really shot up. I believe Java 18 will be available later this month but you should be OK for a good while with 17 which is a 'long term support' version. --PureFox (talk) 10:57, 11 March 2022 (UTC)