Hasty Briefsbeta

Bilingual

Counting permutations with roots

13 hours ago
  • A Mathematica code for finding the probability that a permutation of n elements has a kth root was presented, using a generating function.
  • The code initially hung due to using Infinity in the product, but replacing Infinity with n resolved the issue.
  • The author converted the Mathematica code to SymPy with help from Claude, and tested it by reproducing a table of f(n,k) values from Wilf's book.
  • SymPy code is provided, including functions for truncated series coefficients, polynomial multiplication, and the main probability calculation.
  • Output tables for k=2 through k=7 show the calculated values of factorial(n)*p(n,k) for n from 1 to 10.