Questions tagged [order]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
32
votes
5answers
3k 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 ...
20
votes
4answers
3k views

How to keep Collect[] result in order?

For example, Collect[(1 + x + Cos[s] x^2)^3, x] gives the result ...
14
votes
3answers
239 views

Ordering Problem With VoronoiMesh

Imagine I want to model 2D cells moving in a tissue. Consider, as an example, Lloyd's relaxation algorithm. Using VoronoiMesh I'm able to mimic some cell movement. ...
13
votes
4answers
921 views

ListPlot join points by nearest neighbor rather than order

I have found some software that allows me to "data mine" the values from publication figures. I have a bunch of contours from papers that I've mined using this software, and am having some trouble ...
10
votes
3answers
1k views

How do I get a two-term polynomial with a leading negative sign to display in the correct (i.e. textbook) order?

The first three expressions evaluate as expected and the polynomial is displayed in what I would call "textbook" form. The last expression, however, switches the order of terms. Mathematica employs ...
8
votes
4answers
430 views

SortBy first element then second element, and so on?

SortBy can sort list by first element easily like so: SortBy[{{1, 6}, {1, 2, 8}, {2}}, First] and the result is: {{1, 6}, {...
8
votes
2answers
508 views

Best way to insert element into an ordered list at the correct position?

Suppose I have an ordered list orderedList and I want to write some code that will involve regularly inserting new elements into ...
7
votes
2answers
255 views

How does Query decide the order in which the functions are applied?

First of all I know that Query is a nice way to organize your functions that are applying at specific levels of an expression. But I don't understand the order in ...
7
votes
1answer
186 views

Cross product without reordering (noncommutative)

Not related to question I assume this question (as it is of very general structure) might have been asked before, unfortunately I did not find an answer to it - despite what I used as search queries. ...
5
votes
3answers
997 views

How can I reorder the factors in the terms of a polynomial?

How can I reorder the factors in the terms of a polynomial? Consider ...
5
votes
1answer
75 views

Ascending and descending in the context of the order of operations on Datasets

I did not understand the concepts ascending and descending in the context of the order of operations on Datasets. It is listed in the documentation, on Dataset's page and yet I did not understand. ...
4
votes
2answers
147 views

Cyclically Flat Functions

Any idea how to define some operator ° such that e.g. $((a°b)°c)°d=a°(b°(c°d))=a°b°c°d=b°c°d°a$ (but $a°b\neq{b°a}$ in general)? So ° is Flat plus (insert here)?
4
votes
3answers
446 views

Change Contour Plot Overlap Ordering

I have a contour plot for which I have selected a finite set of contours. However, the contours overlap in some places and I would like to reverse the order in which they are drawn. In other words,...
4
votes
1answer
72 views

Concise way to do lexicographic ordering

I want to order a bunch of number sequences lexicographically. Did this with ...
4
votes
0answers
111 views

How do I reassign the ordering of symbols in a polynomial expression?

I have a big polynomial expression, like this: ...
3
votes
2answers
903 views

Permuting elements within a list

I have s = {2, 3, 5, 7, 1, 4, 6} (* always with diffente elements in {1,2....7}*) l = Length[s] n = 3 and n tells us that we ...
3
votes
1answer
272 views

ordered tree data structure

I have a map $f:X\to \mathbb{N}$ and I wish to find $x,x'\in X$ such that $f(x)=f(x')$. Since such elements are rare, I will have to check very many elements and perform many comparisons, so I suspect ...
3
votes
1answer
131 views

Symbol Order for Built-in Functions such as TrigReduce

I’d like to use the TrigReduce function on a sum of n sinusoids to any power, and am running into an issue with Mathematica’s default ordering of symbols. Is there a way that I can specify an order ...
3
votes
0answers
66 views

How to simplify a polynomial and get the results in the order that I want? [duplicate]

How to simplify a polynomial in a order that I want? Assume that I have a polynomial here, for example, $a^3 b^4 c^2$, the order of symbels is the dictionary order, $a>b>c$. But what if I want ...
2
votes
2answers
47 views

How to reorder {x,y} list data and plot as ListLinePlot

How to re-arrange data to find line plot in order (I tried with given below code). ...
2
votes
1answer
46 views

Does Mathematica have an order relationship for lists, or a general ordering relation?

{1, 2} < {3, 4} doesn't seem to work, but Sort[{{3, 4}, {1, 2}}] yields {{1, 2}, {3, 4}}. ...
2
votes
1answer
59 views

Inverse of matrix up to some order

Let $A(t,s)$ be a matrix of any size (potentially large), whose entries are polynomials functions wrt $(t,s)$ of order $N$. I would like to compute the inverse $X$ of $A$ up to the order $N$ that is $...
2
votes
1answer
22 views

ordered set inclusion 2

Slightly change the previous question, ordered set inclusion, Now, consider $A=\{2,3\}$ and $B=\{2,3,4,5\}, C=\{5,2,4,3\}$, Now I want to make element $\{2,3\}$ is in $B$ as well as $C$, what can be ...
2
votes
1answer
32 views

ordered set inclusion

Suppose I have a ordered set $A=\{2,3\}$ and $B=\{2,3,4\}$ and $C=\{2,4,3\}$. Is there any mathematica command whether $A\subset B$ gives true(or 1) but $A$ which is not a subset of $C$ gives false(or ...
2
votes
1answer
2k views

What is “standard” or “canonical” order? [duplicate]

When trying to sort a list of fractions and quadratic numbers I'm trying to work out why sort orders the quadratics after the fractions. It seems to use the function "OrderedQ" and "standard order" or ...
2
votes
0answers
50 views

Map Inverse Ordering on Matrix [duplicate]

I have an matrix (symmetric, but any $n \times n$ will do) $$A = \begin{bmatrix} 0 & 4.5 & 6 & 5.5 \\ 4.5 & 0 & 4 & 3 \\ 6 & 4 & 0 & 5 \\ 5.5 & 3 & 5 &...
1
vote
4answers
190 views

How would we extract elements of a list greater than a certain value? [closed]

Say we have a list {35,210,67,950,32,365} how would we extract all the elements greater than 100 from this list (using a function)? The desired output would be ...
1
vote
3answers
807 views

Matching the order of a master list of lists from a random list of lists

Using Mathematica 9, I have 2 lists of lists one master with dimensions {300, 6}. The second is some random order but has the same first ...
1
vote
4answers
108 views

Sorting a function

So I have a function f[x : {{_, _} ...}] := f /@ x; f[a_,b_]=:a+b. I can input f[{1,2},{2,0},{3,4}] and get ...
1
vote
1answer
48 views

l,r-operations on words $[[[1,2],3],4] \cdots, n]$, $[1,[2,[3,\cdots, [n-1,n]\cdots ]]]$

Suppose I have a word $\{1,2\}$, then $l(\{1,2\}) = \{[1,2]\} = \{1,2\} - \{2,1\}:=12-21$ and for the word with length $3$, (I will omit bracket), the $l$-operation is defined as $ l(1,2,3) = [[1,2],3]...
1
vote
1answer
437 views

Variable order in output

I have two questions about editing my output in Mathematica. I want the variables to be to the right of the fractions with the parameters. Update ...
1
vote
1answer
93 views

Sorting the words of a phrase by defined variables/associations

Is it possible to change the word order of a phrase by creating a list of possible values/variables and using the Sort function? I want a specific word order always. $(a>b>c>d)$ But the ...
1
vote
1answer
160 views

Is the output to Solve ordered or are the solutions randomly placed?

I am trying to find the roots of a polynomial of eight degree $$\sin^8\varphi-2\lambda_i^2\sin^6\varphi+(6\lambda_i^2+\lambda_i^4)\sin^4\varphi-(4\lambda_i^2+2\lambda_i^4)\sin^2\varphi+\lambda_i^4=0$$ ...
1
vote
0answers
32 views

Yet Another Expression Ordering Question (not polynomial but transcendental)

Forcing a particular ordering of terms, i.e. overriding Mathematica's, is a recurrent issue, especially for users working within particular domains where there is a particular ordering tradition or ...
1
vote
0answers
23 views

Consistency of sample quantile to population quantile for discrete variables [closed]

Can I know if the sample quantile converges to the population quantile in probability for discrete variables? If we use Hoeffding (1963)'s results, is this true?
1
vote
0answers
64 views

Dealing with positive power variables in Taylor expansion and assumptions

I would like to compute the Taylor expansion of monomials whose powers are nonnegative rational variables. First, here is a function which encodes the multivariate Taylor expansion at the points <...
1
vote
0answers
112 views

Upvalues and order of interpretation

I'm trying to use UpValues to improve the usability of some code, but I am running into an issue where the order of the UpValues is important, and I am not sure if it is my understanding or a ...
0
votes
1answer
40 views

Order of evaluation of variable

I'd like to control the order of evaluation in a multi-variable function. Example: Suppose I have the function: B[x_, y_] := x + y/x; If I try to evaluate ...
0
votes
1answer
94 views

how to order a parameter by power?

for example, y=a x^2+ a(b x^2)+c^3 x^2+z^2+c z how to tansfer function y to formart like y=?x^2+ ?x+? and y=?z^2+?z+? So, I want to tansfer the equation below to arrange both A_{2l} and A_{2h} (one ...
0
votes
1answer
110 views

Breaking term order ties [duplicate]

I am interested in creating a table with positive Gaussian integers listed in order based on their norms, with ties broken by lex order. So far I have ...
0
votes
0answers
15 views

How to reverse or restore the order of my cells in Wolfram Mathematica Cloud?

I was completing my assignment and I have no idea what I clicked but all the cells got reversed that is the 1st one on the last and the last is the first cell in my file. I want to restore it back. I ...
0
votes
0answers
159 views

The order of evaluations with nested slots [duplicate]

I tried to join a series of evaluations with nested slots as follows: #^2 & /@ #^2 & /@ Range[10] However, the results were somewhat different from what ...
0
votes
1answer
233 views

Ordering of monomial terms

I have monomials with variables $a_1,\, a_2,\,\dots$ also their complex conjugates. I found that their order within the monomial depends on at which point I set the overline for the complex conjugate. ...