# Tag Info

## Hot answers tagged functions

Accepted

### Finding an ellipse of minimum area that encloses a set of points

You are looking for BoundingRegion with the "MinEllipse" region specification: ...
• 67.6k

### C++' "do ... while" loop equivalent in Mathematica

Version 13.1 introduced the function Until Until[test,body] evaluates body and then test, repetitively, until test first gives True.
• 69.7k
Accepted

### Which functions use a given option?

You can use WolframLanguageData with the property "SymbolsUsingAsOption" for this: ...
• 34.4k

### How to optimize performance with DeleteDuplicates?

In checking duplicates, you are considering 2, 4, 6, 8, 10 are the same as 1, 3 ,5, 7, 9, respectively. Then, instead of testing all possible replacement, I recommend you to convert into standard ...
• 2,960
Accepted

### How does this code work?

+## stays for Plus[##] and 1 ## for Times[##]. So it ...
• 21.4k

### Stopping mathematica from rearranging elements in a list

You can use DeleteElements which came with V 13.1: ...
• 82.6k
Accepted

### Are there any better methods to solve this problem?

Function ForAll and Resolve help. ...
• 2,285

### Perform Apply[] to a sum of objects

As of version 14.0, ComapApply is introduced: ComapApply[f + g, {a}] (* f[a] + g[a] *) ComapApply[f + g]@{a} (* f[a] + g[a] *) ...
• 67.7k

### How to raise a vector to powers contained in a vector, change the list into a product, and do this for all the lines of a matrix, efficiently?

Use Inner Inner[Power, var, #, Times] & /@ expo (* {x[1],x[2],x[3] x[4],x[2] x[5]} *)
• 2,960

### Is there a better way to achieve the same result with {f[#],g[#]}&@list?

In version 14.0, Comap was introduced exactly for this purpose: ...
• 31.2k
Accepted

### How to draw an image similar to a periodic function (f [x+1]=2 f [x])?

Edit For x<0,we rewrite f[x+1]=2f[x] to `f[x]=f[x+1]/2; ...
• 79.8k
Accepted

### How to use the symmetry of a function to find the analytical expression of a function on a certain interval?

f[-x] == -f[x] means that the graph is point reflection respect to {0,0}. f[1-x]+f[1+x]==2 ...
• 79.8k
Accepted

### Reversing the order of function arguments by a replacement rule

expr = g[x3, x2, x1]; You must use RuleDelayed (:>) instead of Rule ...
• 82.6k
Accepted

### How to use || as a function name and apply it to calculate the equivalent resistance of parallel resistors as we typically write?

It won't work with || for reasons described in the comments. However, you can use a unicode character or ...
• 25.6k

### Blurry shadows of 3D plots and objects

I've tried adding multiple semi-transparent shadows at different angles: ...
• 3,500

### What is a simpler method to find the analytical expression for the function f[x]?

Eliminate[{f == x + 1/x, t == Sqrt[x] + 1/Sqrt[x]}, x] (* t^2 == 2 + f *) from which $f(t)=t^2-2$ follows immediately with ...
• 49.3k
Accepted

### How to invert this function when the argument e is small?

As @userrandrand suggests, series-expand the function in $\epsilon$ and then invert the series: ...
• 49.3k

### Stopping mathematica from rearranging elements in a list

UniqueElements[{set1,{ -1/x}}][[1]] (* {-x^(-1)+x/2-2*Log[x]-Log[x]/x,1} *)
• 21k

### How to draw an image similar to a periodic function (f [x+1]=2 f [x])?

Plot[With[{qr = QuotientRemainder[x, 1]}, 2^First[qr] Last[qr] (Last[qr] - 1)], {x, 0, 3}]
• 3,619
Accepted

### How to fit function with data?

Provide initial estimates for a and b ...
• 161k

### How to fit function with data?

NonlinearModelFit default settings work ok with simpler model and thena and b can be derived,...
• 63.1k

...
• 67.6k

...
• 1,950

### Undocumented behavior of Fold for arbitrary heads

This behavior is actually documented further down in the page in the "Scope" section, so you can rely on it not changing in the future. The head of the third argument need not be List: <...
• 69.7k

### How to stop mapping on true results for large lists?

The AllTrue function will short circuit. AllTrue[list, EvenQ] But I may have misunderstood, because you said you want short-...
• 31.7k

### How to stop mapping on true results for large lists?

You can use AnyTrue. AnyTrue short-circuits on first True result and returns ...
• 43.1k
Accepted

### Define a function on a single element but linear in sums

Just reorder the two definitions, so that the one for sums comes first. You can read more about it in the tutorial The Ordering of Definitions. ...
• 31.2k

### Given two functions, generate all nested applications of the functions to a given order

First level a = {f[x], g[x]}; Second level b = Flatten @ Transpose @ Query[All, {f, g}] @ a {f[f[x]], f[g[x]], g[f[x]], g[g[x]...
• 82.6k
Accepted

### Given two functions, generate all nested applications of the functions to a given order

Using Composition: ...
• 56.2k