Questions about the use of built-in Mathematica functions, including pure functions.

learn more… | top users | synonyms

2
votes
4answers
5k views

Calling Correct Function for Plotting DiracDelta

I am wondering what is the correct function in Mathematica to plot the true impulse function, better known as the DiracDelta[] function. When using this inside of a ...
-2
votes
1answer
244 views

Gamma Incomplete Function representation in Mathematica and Matlab

I am confused about Gamma Incomplete function calculation in Mathematica and MatLab: For example, in Mathematica: Gamma[5,3] = 19.56 But in MatLab: ...
8
votes
1answer
301 views

ReplaceAll[] and Limit[] don't give correct results for this expression under extreme variables [duplicate]

Possible Duplicate: Funny behaviour when plotting a polynomial of high degree and large coefficients 1/x^2 + (3 + x)/(6 (1 - Exp[x] + x)) ——This is a ...
3
votes
1answer
229 views

NestList with a list inside?

I'm new to Mathematica, and was looking for more efficient ways to implement the Do loop below. a, ...
3
votes
2answers
544 views

Function returning Null along with other unexpected expressions

When I use some function, at the end along with the output I get some NULLs returned that I don't understand the reason for and are highly undesirable. For example, when I define the reversal of list ...
17
votes
1answer
183 views

How to get Cases to wrap results in an arbitrary head?

A number of functions provide for results to be wrapped in an arbitrary head. This is very important in cases where the results should not be evaluated. Take ...
10
votes
5answers
486 views

How to find first list element that differs from average of N previous elements by more than a given amount?

Given a list of real numbers, I need to write a function that returns the value of the first element in the list that differs from the mean of the previous $N$ elements by greater than $P$ standard ...
15
votes
4answers
4k views

Finding Limits in several variables

Is there a way to find a limit of a multivariable function, like $$\lim_{(x,y)\to (0,0)} f(x,y)$$ with Mathematica? When $f$ is continuous, we can use $$\lim_{(x,y)\to (0,0)} ...
12
votes
1answer
12k views

How to express trigonometric equation in terms of of given trigonometric function?

How can I express a trigonometric equation / identity in terms of a given trigonometric function? using following trigonometric identities ...
10
votes
1answer
645 views

Growth of functions

Does somebody know if Mathematica can be used to calculate the growth of functions, that is in Big O, Theta, and Omega and find proper $n_{0}$ and $c_{1}$, $c_{2}$ respectively?
8
votes
1answer
438 views

What is the difference between prefix/postfix notations and map?

I am new to Mathematica and just experimenting with the different programming constructs. I have been looking at Map and how to evaluate a function for a list of ...
4
votes
3answers
547 views

Simplify function notation

I have some calculations with arbitrary functions. In the output, Mathematica always shows the functions with its arguments. I would like to tidy the notation a bit, by hiding the arguments in the ...
20
votes
2answers
431 views

Why is Query so much slower than Part?

Time for another of these(1),(2) as yet another new-in-10 function appears to have poor performance compared to older alternatives. This time: Query appears to be ...
15
votes
2answers
735 views

Why do certain values in ArcSin not fully evaluate?

This is a continuation of: Why do certain fractional values in TriangleWave not evaluate? The analysis by R.M and rasher revealed that problem to reduce to the behavior of: ...
8
votes
3answers
192 views
14
votes
5answers
343 views

Partitioning a list of numbers the Mathematica way

I have two sorted lists, one list will be called the "fences" and the other the "values" Fences could be: $\{1, 5, 9, 14\}$ Values could be $\{-1, 1, 3, 4, 6, 9, 10, 13, 14, 15\}$ I want to ...
11
votes
4answers
402 views

Plot the minimum of a list of functions

This is my first question on any stack-exchange site and I'm also very new to using Mathematica software so please excuse/correct me if I mess up. I would like to take a list of functions of a single ...
11
votes
4answers
299 views

Using With to scope over pure functions

Consider this example: given an option for a function func as "x" :> (a&), how can one assign different values to ...
8
votes
2answers
240 views

Tally repeated evaluation of function

How can I tally the result of repeated evaluation of a function? n=100000; f[]:=RandomInteger[{1, 4}] Tally@Table[f[], {n}] When ...
3
votes
2answers
315 views

Manipulating slots in a pure function

How does one manipulate the slot numbers in a pure function? Some trick with Evaluate or Hold? I'm aiming for something along ...
10
votes
1answer
199 views

How to pass composite function list to SortBy?

In order to sort alphanumeric-as-string data of the form {"T3", "T14", "T1", "E2"}, so that "T14" comes after ...
9
votes
2answers
297 views

Define Log so that negative reals evaluate on lower edge of branch

I need to get Mathematica to evaluate the logarithm of a negative real number using the lower branch instead of the upper branch, so that while ...
9
votes
1answer
233 views

Get the name of a symbol passed to a function

I'm trying to get the name of a symbol passed to a function with this: f[x_] := {SymbolName[x], x} SetAttributes[f, HoldFirst] x = 5; f[x] But ...
9
votes
3answers
371 views

Why does Hash return different values in Version 7?

This function does not work correctly for me. The generated Gravatars do not match the ones actually produced by using the corresponding address. The problem was traced to differing output from the ...
7
votes
3answers
441 views

Difference between @ and @@

I am confused by the commands @ and @@. From the documentation, I learnt that @@ is the ...
7
votes
3answers
306 views

Why can't D[] be used in place here? [duplicate]

Possible Duplicate: General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it? Beginner question: Why can't I use ...
4
votes
0answers
81 views

Make Mathematica show function template's arguments in different lines (i.e. in column) by default?

I feel a bit uncomfortable with Mathematica 10's layout. I mean, I'm impressed how powerful functional programming can be and so on, but it's me or those programs are often just a bunch of nested ...
3
votes
2answers
208 views

Selecting for 2D points that are within a threshold distance of an upper- and lower-bound number of points

I have a very large set of 2D points: numberOf2DPoints = 10^6; pointList = RandomReal[{0, 1000}, {numberOf2DPoints, 2}]; I'd like to find a way to quickly ...
3
votes
0answers
86 views

Gather dependency on list order?

I get intrigued about Gather behavior on this post. I thought that Gather was invariant under list order? Here is the result I ...
3
votes
3answers
612 views

Solve with v9 (issues with Subscript, Overscript, Superscript etc)

The way Solve works has changed in v9 ... in essence, to get the answers that one obtained under v8, one now often has to specify a lot more information about all ...
8
votes
2answers
662 views

Determine whether some expression contains a given symbol

Given a symbol t and an expression expr, how can I determine whether or not the symbol t ...
6
votes
1answer
468 views

Evaluate continued fraction

Mathematica has the ContinuedFraction[] function to give the continued fraction expansion of a rational (or approximation of a real) number. I'm interested in the ...
4
votes
2answers
516 views

ArcTan[z] and ArcTan[x,y], Restriction and Conversion

In Mathematica there are two different forms for the arctangent (inverse tangent), namely ArcTan[x,y] which gives the arc tangent of $y/x$, taking into account ...
3
votes
2answers
2k views

Plot Even Piecewise function

Is it possible in Mathematica to plot an even piecewise function like: $ f(x) = \begin{cases} 3t , 0 \le t \le \frac{\pi}{2} \\ 3t + 6 , \frac{\pi}{2} \le t \le \pi \end{cases}$ which has ...
3
votes
2answers
433 views

How can I assign a Fit result to a function?

I have this code ...
3
votes
2answers
315 views

What is the command to find function invariant?

What is the command to find function invariant? http://demonstrations.wolfram.com/AFunctionInvariantUnderAGroupOfTransformations/ what is algorithm it use to calculate this? Edit there is a book ...
2
votes
1answer
166 views

Finding average error of the data

Considering I have some data, and I want to fit the data to a linear fit and find the average error from the linear fit, how can I do that using Mathematica? I have ...
2
votes
1answer
144 views

Representation of product with exclusions

Is there a nice way to define output formatting for my expression, a product from n = k to j with ...
0
votes
1answer
105 views

A problem with set values

The following code is just an example to clearly explain my problem. Assume that : ...
0
votes
1answer
108 views

Can I force a function to quit and return some value after a certain amount of time has passed during its evaluation?

Imagine I provide some random input to function like FindInstance[], and I observe that, despite the existence of good solutions, the function will, with some ...
-2
votes
1answer
187 views

How to pass arguments between functions

I have two Functions, f[] and g[]. f is passed some values ,say ...
14
votes
2answers
222 views

What are Root objects with multiple polynomials?

In Mathematica 9 a new flavor of Root object with multiple polynomials was introduced. For example, ...
10
votes
1answer
126 views

How do I expand StirlingS2[n, 10] in terms of elementary functions?

I know that it is possible to expand StirlingS2[n, 10] in terms of elementary functions of n. I tried ...
23
votes
1answer
217 views

What does Internal`InheritedBlock do?

What does the function Internal`InheritedBlock do? How is it different from the regular Block?
18
votes
1answer
287 views

What does “EquationalLogic`FindCounterexample[]” do?

I found the undocumented EquationalLogic`FindCounterexample[] by browsing the lists of available symbols, but I have no clue about its purpose. The name is ...
13
votes
4answers
397 views

How to make a function with its own options as well as passing options to other functions [duplicate]

I have a function with many of its own options, but I would also like to pass options to subfunctions using the FilterRules function. Here's a simple example: ...
16
votes
5answers
5k views

How to find the domain and range of a function with Mathematica?

I'm studying calculus and in some exercises I am asked to find the domain and range of a function. Does Mathematica have already a built-in function for this? I can imagine some ways of doing so, ...
9
votes
2answers
201 views

How can I make Which format its output?

Functions like Piecewise have cool, easy-to-read formatting. In the same vein, I think it would be wonderful if the Which ...
14
votes
1answer
310 views

How to represent a continuous monotonic phase of Airy functions?

Note: In this question I am concerned only with real-valued variables and functions. DLMF, §9.8 Airy Functions, Modulus and Phase, formula $9.8.4$ defines the phase of Airy functions: ...
8
votes
2answers
531 views

Can you apply the Cellular Automata function to a grid containing numbers?

Im attempting to simulate a simple evacuation model using cellular automata theory.My study aims to determine whether Cellular Automata can effectively represent how people would behave in a fire ...