4
votes
3answers
187 views

Counting number of inversions

Is there an inbuilt method to find the number of inversions in a set of numbers? I found Inversions in Combinatorica but when I ...
0
votes
1answer
62 views

Sorting lists of lists with string elements [closed]

I have a list of sublists. One element of each sublist is a string element. For example: list = {{1, "banana", 3}, {3, "orange", 1}, {2, "apple", 2}}; When I ...
18
votes
5answers
686 views

How do I reassign canonical ordering of symbols?

I have a big polynomial that evaluates to: $$A^2 e^2 \phi ^- \phi ^++A e \phi ^- \phi ^+ c_{2 w} g_Z+\frac{1}{2} A e g h W^- \phi ^+ +\ll13\gg,$$ which is supposed to represent some terms in the ...