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

learn more… | top users | synonyms

4
votes
3answers
2k views
1
vote
2answers
185 views

Expectation over a list with nested-mapped expressions

I need expected values of a list where the random variable to take expectations over should be an input into expressions defined earlier. I suspect Set[] and SetDelayed[] tripped me. (Or Map and ...
6
votes
5answers
252 views

How to nest my own “times” function to get powers

I have a "times" function. I'd like to create a power function using it. It should look like this for an 6th power: ...
2
votes
3answers
225 views

How to Compute Aggregate Best and Worst Cases for a Large Number of Estimates?

I need to aggregate multiple estimations, but I haven't been able to find a built-in function in Mathematica that aggregates multiple probablity estimations (I am specially interested in estimations ...
11
votes
4answers
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, ...
0
votes
2answers
124 views

About minimizing calculations when using ComposeList

I have a lot of functions to use in a iterative way, and I need some of the calculation results. For example: ...
7
votes
2answers
1k views

How to create a rectangle wave (duty cycle $\ne$ 50 %)?

I'm trying to use phase-shifted SquareWave[] functions to create a rectangle wave: ...
2
votes
2answers
143 views

Custom function not returning any output

I'm trying to write a custom function but it isn't returning any output. Here's my code so far: ...
2
votes
2answers
390 views

decompose a number (less than 255) in a sum of powers of 2

Is there a built in function that would take a number and decompose it into a sum of powers of 2? The numbers will be non negative less than 256. For what it's worth I'm trying to understand a paper ...
5
votes
1answer
125 views

How to make the Show function work in this case?

I can't get this to work, the Show function shows only the first plot. Why this happens and how to solve it? Show[Plot[x^2, {x, 2, 10}], Plot[1 - x, {x, 1, -10}]] ...
7
votes
2answers
189 views

Why does Solve and Sum give different answers when according to Table it is the same sequence?

I have been thinking about a piece of code today, but I don't understand why I get different outputs from two in my mind similar Mathematical sums. First I observe that the Table command for this: ...
2
votes
2answers
384 views

Conditions for Piecewise[ ] Command

I am trying to plot a function in which is piecewise defined. I found the Fourier coefficients of this, and my question is how to define even & ...
2
votes
3answers
420 views

Output of plots from within Do[ ] Command

I am wondering why the following does not plot the way it's written and exactly how does the Do[] function operate? I think I could be using it incorrectly. ...
13
votes
3answers
274 views

How to keep some of the results of the NestList

I'm using some iterative arithmetics to calculate wave propagation with the help of NestList. I have to use a small step size for iteration to guarantee the accuracy, which lead to too much data (e.g, ...
8
votes
1answer
709 views

(Non-Convex) Polygon Union and Intersection Functions [duplicate]

Possible Duplicate: Intersecting graphics Back in 2009 I posted a question in comp.soft-sys.math.mathematica looking for a function which generates the union of two (not necessarily convex) ...
2
votes
3answers
161 views

Using Nest inside NestList

I need results like this: {Cos[Cos[x]], Sin[Cos[Cos[x]]],Cos[Cos[Sin[Cos[Cos[x]]]]], Sin[Cos[Cos[Sin[Cos[Cos[x]]]]]], ... } I've tried to use ...
10
votes
1answer
196 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 ...
1
vote
3answers
1k views

How to write values of function to file?

For example, say I wanted to plot Sin(x) like this: Plot[Sin[x],{x,0,2 Pi}] But instead of plotting to a graph, I want to now tabulate the values of Sin[x] to a ...
2
votes
3answers
196 views

Ways to change an explicit function into a pure function

I'm trying to use FixedPoint to solve a transcendental equations, but the first argument of the FixedPoint should be a pure ...
6
votes
4answers
275 views

Why does my function defined with constraints on patterns not work? [duplicate]

Possible Duplicate: Why doesn't PatternTest work with Composition? My function is something like this, ...
-3
votes
1answer
639 views

How to find the maximum value and the argument of a function of three variables y dividing into grids?

I am dealing with a non-linear function of three variables, namely R0k, R1 and alpha. To find its maximum value, I divided the three variables into grids and maximized the function by plotting the ...
2
votes
2answers
388 views

Cannot evaluate differential in Mathematica

I have a small toy script in Mathematica that I am trying to use to evaluate the pdf of $Y$ where $Y=X^2$, and $X$ is uniformly distributed in $[0,a]$. The script is, ...
5
votes
1answer
621 views

Nesting multiple functions of multiple variables

I was wondering how one would go about nesting multiple functions of, say, two variables. The problem comes from trying to implement the Chirikov standard map without using "for" cycles. I found a ...
8
votes
2answers
647 views

What is the Mathematica equivalent for the Excel function tinv()?

TINV() returns the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom. For example ...
9
votes
1answer
223 views

What default theoretical distribution does Mathematica use in PearsonChiSquareTest?

I used Mathematica's function PearsonChiSquareTest to test whether the data were drawn from a normal distribution. As in the reference, I expected Mathematica to compare the result to a normal ...
9
votes
1answer
292 views

Defining Tags in Reap

I am trying to use Sow/Reap to replace Append in my code. The problem is that I need to ...
6
votes
2answers
257 views

How to choose variables from a list for a function and then use the solution in a subsequent function?

I am trying to calculate heating degree days and cooling degree days and output that information to a table. I am using mathematica's curated data to do this. In text this is what I would like to ...
1
vote
1answer
259 views

Mapping and Interpolation

Does Mathematica have a mapping function like scipy or any of the multidimensional ones? By this I mean something like mapping $[1,100]$ onto $[7,20]$ for example. Looking at Interpolate I only ...
5
votes
1answer
223 views

Can we know the background code associated with basic mathematica functions

I wanted to know how computers calculate basic functions like Sqrt so first I checked how humans do it I found that they use something called "Newton's method" that ...
7
votes
1answer
326 views

LogLikelihood function from the Time Series package is apparently missing

The Time Series package for Mathematica comes with a function called LogLikelihood. It is discussed and used extensively in the documentation (pdf). So does ...
8
votes
1answer
648 views

How can you use and convert Gauss-Krüger-Coordinates in Mathematica?

I am given geographic data in the form of Gauss-Krüger-Coordinates and would like to calculate distances with them and convert them to longitude/latitude coordinates in another system for plotting ...
20
votes
2answers
1k views

Implementing continuous phase/Arg function

In MATLAB there's a function called phase that is just like our Listable friend Arg, but ...
19
votes
3answers
923 views

How to load a package without naming conflicts?

This question applies to any package, but I encountered this problem while working with graphs. There are symbols in the Combinatorica package (such as ...
-1
votes
1answer
376 views

inverse function not working — but providing values for some arguments, a symbol otherwise?

Could you help me with what Mathematica is doing here, in the last lines? (The rest is here for context.) I removed the output to let you simply run this. Thanks. ...
3
votes
5answers
490 views

How to use summation to get the value of a binary number?

How to use summation to get the value of a binary number? I want to do this: $(x_{n}x_{n-1}...x_{0})=\sum_{i=0}^{n}x_{i}\cdot b^{i} $ But it seems that I can only do something like this: ...
4
votes
1answer
256 views

How do I use the result of Solve in a function definition?

I'm trying to adapt the following piece to the part where PowerF is a function of amax. ...
9
votes
1answer
1k views

Using RegionFunction on multiple plots

I realize that the Plot function can plot multiple functions of x at the same time, using { }. I also know that the ...
3
votes
7answers
697 views

Defining an integer-valued function on an integer domain

This should be an easy question! I want to define a function with domain = the 12 integers {1,12}, with the values f[1]=31, ...
13
votes
3answers
454 views

Is it possible to get the order of inputs when “overloading” an orderless function?

When working with symbolic matrix operations or other objects which don't have commutative multiplication, it would be nice to not have to constantly switch out times for ...
6
votes
2answers
613 views

Why does Expand not work within a function?

I'm writing this fairly simple function: ...
7
votes
3answers
437 views

How to create a list of pre-defined functions?

I would like to create a list of Cauchy distribution pdf's, having different locations of their maxima, and being multiplied by different factors; then I'd like to calculate those functions' values ...
10
votes
2answers
103 views

Functions in a different context are replaced with infix forms of their namesake in System`

So, in an attempt to help out Fabian with his question, I did what I often do, and created a new symbol in the Pillsy` package that I could play with. Since it was ...
21
votes
3answers
434 views

Is there a bug in Pick?

I wanted to use the Pick function with a condition. But there seems to be an issue here. Take a look at this: ...
5
votes
2answers
305 views

How to find Matano plane

I have discrete collection of data points (10 to 10^4). I want to describe them by a continuous function and find a x value z, ...
3
votes
2answers
621 views

Is there a function to calculate studentized range?

Is there a built-in function for studentized range or do I have to build it myself? Is there a test of normality for the studentized range?
3
votes
2answers
196 views

How to use ForAll in Reduce

I was wondering: how does one use the ForAll function in Reduce? In particular, I am looking for the set $\{w\in \mathbb{R}^2 | ...
3
votes
4answers
1k views

How to convert binary float to decimal float

I need to convert binary float to decimal float in Mathematica, ideally between any two bases. FromDigits["1.111111", 2] does not work.
58
votes
3answers
1k views

Automatically generating a dependency graph of an arbitrary Mathematica function?

Has anyone written a function to pull the function dependencies of a function? That is, it would be nice to have a function that returns a list of function dependencies as a set of rules, terminating ...
5
votes
0answers
70 views

Graph relationships between functions and variables [duplicate]

Possible Duplicate: Has anyone written any function to automatically build a dependency graph of an arbitrary Mathematica function? I need to make sense out of a huge notebook (17Kloc) ...
3
votes
1answer
235 views

FunctionInterpolation Errors / Question re Evaluation Order and Options

I have using Mathematica functions that takes a Cartesian coordinate relative to the Earth (xyz) and converts it to a latitude, longitude, and altitude (lla). And here it is: ...