Open junwenwaynepeng opened 3 days ago
For an alternative way of writing 'brute force' method, we may also consider listing the image of evolution and then check if the length of the set of the list is equal to the size of the given ground set, as the following code.
if method == 'brute force':
X = self._X
ev = self._phi
if len(set([ev(i) for i in X])) == len(X):
return True
return False
In my experiments, as the ground set is big enough, this method is faster than the one impremented above. It's because we use [ev(i) for i in X] instead of python for loop.
Problem Description
Add a function
is_permutation
in theFiniteDynamicalSystem
to determine if a given function is a permutation on its domain. Specifically, I propose to createis_permutation
to help us determine if a given polynomial or rational function induces a permutation over a finite field.Proposed Solution
The following code is implemented by Will-Chen2025
Alternatives Considered
Our experiment and concerns:
.cycle()
. However, we choose to use.cycle()
for better styling.Additional Information
No response
Is there an existing issue for this?