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

learn more… | top users | synonyms

1
vote
1answer
151 views

using a Mathematica function to define a new function

I'd like to define a function of three variables which produces a new, named function of a single variable, where this final variable is not a member of the first three. So I'd like something where I ...
4
votes
1answer
191 views

Strange result for the analytic integration leads to Hypergeometric2F1

The integration result for Integrate[1/(r^2 Sqrt[x/r^(4 - 2 \[Gamma]) + 1]), r] is: ...
2
votes
1answer
77 views

What is the need for function parameters? Many possible inputs

If I have many possible variables related to one another, why do I need to define my function with parameters for plotting? For example, if I have an equation like: ...
2
votes
1answer
76 views

Behavior of ValueQ inside a function

The following code Cases[Function[{x}, x + 1], a_?ValueQ :> Hold[a], ∞, Heads -> True] unexpectedly returns {Hold[x + 1]} According to the manual, ...
0
votes
0answers
89 views

How to apply a tensor to a list of arguments

The problem I have is the following: Let C be a list of coordinates, say, C = {x1, x2, ..., xn} and ...
1
vote
1answer
162 views

Split Lingustic(IPA) at Words Unique Sounds

How might I split a word at each IPA of each unique sound. For example {"pray", "wade"} (* {{"p","r","ˈeɪ"}, {"w","ˈeɪ","d"}} *) ssch answered a question here ...
8
votes
1answer
235 views

Two ways of map a function on the list: Which one is faster?

There are 2 ways to make a function listable on the list: Use Map or use SetAttributes. My question is, which one is faster, ...
4
votes
1answer
248 views

How to express an expression with only ArcTan and ArcTanh?

I have an expression which is simply (j/k) x^(j/k) LerchPhi[x,1,j/k)] where 0 < j < k. Manually I have been able ...
2
votes
2answers
238 views

Are there Min and Max functions that work properly on Intervals?

Mathematica overloads the Min and Max functions to retrieve the lower and upper bounds of an interval. I need functions that ...
-5
votes
1answer
82 views

Converting function into differential version

I am looking through a journal and I came across a function that I wanted to convert to its differential version using Mathematica. Would anyone be able to get the differential version by using ...
5
votes
1answer
140 views

Reverse engineer a sample value from a CDF

The image below shows the cumulative distribution of a normal distribution with mean = 4 and standard deviation = 1. Notice that if you have a value with a rank of 0.8 (meaning it would be 80th item ...
1
vote
1answer
76 views
6
votes
1answer
142 views

The third argument of the Root function

Consider the roots of an arbitrary indecomposable polynomial: sol = Solve[x^5 + 2 x + 1 == 0, x] The returned expression is ...
7
votes
1answer
121 views

Understanding FullForm in front end

I want to understand the following effect better (In Mathematica 9) .. Or, maybe, is it a bug? Running the following line FullForm[Subscript[α,β_]] gives as ...
0
votes
0answers
65 views

creating some smooth density functions

I would like to create some density functions based on some distance measure $D$. As a base density function lets say I have a Gaussian density $f$ with mean $-1$ and variance $1$. I would like to ...
5
votes
1answer
101 views

Why DateDifference returns machine number?

Is there any specific reason why DateDifference cannot give an exact number in this case? ...
6
votes
1answer
169 views

Iteration process involving several functions

I would like to carry out a following iteration process: Apply function f1[a_,b_,c_,d_] to a starting list l1={a1,b1,c1,d1}, ...
2
votes
1answer
95 views

Function to differentiate between date pattern and specific string format

I'd like to write a function that behaves one way when the argument is a Mathematica date, such as {2013,12,15}, or with added hours, minutes and seconds if ...
1
vote
1answer
124 views

Passing a joined list of symbols for Module or Block to treat as its own local symbols

The Question I'd like to write a function which itself takes a list of symbols, e.g. Foo[{x, y, z}] to pass to Module ...
9
votes
3answers
541 views

How to find the domain and range of an implicit function?

For example, we have this curve: $$ x^2 + y^2 = 1 $$ Is there a function in Mathematica for finding out that the ranges for $x$ and $y$ are both [-1, 1]? What ...
0
votes
2answers
76 views

I want to define a function that has integer power [closed]

I am defining this function: f[x_] = kr*g[x] + (c^l*x^l)/(KIR + c^l*x^l) But I want to make l bigger than 0, so if I evaluate ...
3
votes
2answers
183 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 ...
0
votes
1answer
86 views

Is there any automatic method for rating function arguments importance?

If I have a function: y = 2a + 5b + c It can be easily seen that b is the most important parameter, next ...
2
votes
2answers
147 views

Generation function of recurrence sequence

I'm trying to find generation function of recurrence sequence ...
0
votes
1answer
52 views

Stop function evaluating input at time of definition [duplicate]

I would like to create a function that acts on whether the input is even or odd, e.g.: In[644]:= f[a_] = If[EvenQ[a], 2 a, 3 a]; f[2] Out[645]= 6 I've ...
5
votes
2answers
182 views

Random Matrix with integer coefficients and inverse also having integer coefficients

I'm trying to build a function that gives me matrices such that each: Has integer coefficients. Is non singular. Has inverse which also has integer coefficients. I have some code that one of my ...
-3
votes
1answer
185 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: ...
0
votes
0answers
29 views

Pattern matching list elements in pure functions [duplicate]

Pattern matching here is a functional programming term, but it might be called differently in Mathematica, I'm not sure. It is possible to match the elements of the list in a regular function ...
10
votes
2answers
568 views

NestList on a function of several arguments

I'd like to know if it is possible to use NestList on a regular function of several arguments, such as: ...
4
votes
0answers
164 views

Is everything in Mathematica ultimately stored as a rule?

My current understanding about Mathematica is that everything, at the lowest level, ends up as replacement rules. First question: is this true? Second question: does Mathematica "gloss over" these ...
1
vote
1answer
105 views

Defining a function of a distribution

I have a discrete- time and space markov process that I want to evolve given an initial distribution. To that, I defined ...
11
votes
4answers
280 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 ...
1
vote
0answers
109 views

parameter NDSolve

the question I need to solve is: t x'[t] == -x[t] + y[t], t y'[t] == -5 t^2/x[t]^2 + x[t] - y[t], x[1] == 4, x[b] == 1 in order to solve the coupled ...
3
votes
3answers
170 views

What is the formula for this numerical series?

I'm developing a questions game. My goal is that the score for each correct answer will increase as the user answers more questions. Initially there are 15 points for each correct answer. Every 4 ...
8
votes
0answers
135 views

Limit of sequence of functions behaving strange

I'm trying to determine the limit of the sequence of functions $$f_n(x)=\left(\frac{1}{\pi}\arctan(n x) + 1/2\right)^n. $$ I define ...
2
votes
2answers
163 views

Write 199319989756262759279209 = 5x + y, where x and y are integers

$\frac{199319989756262759279209}{5} $ = $ 3.9864\times 10^{22}$ according to Mathematica, but I would like to see this number exactly in decimal form (not in scientific notation). I'm attempting to ...
6
votes
2answers
104 views

Why is ToRadicals[] not able to handle all cases? Is there a workaround?

The documentation for the function ToRadicals says: ♦ There are some cases in which expressions involving radicals can in principle be given, but ...
1
vote
1answer
120 views

Using NMinimize Properly

I'd like to find the point on a Bezier curve that's closest to some other point. The tricky thing is that because Bezier curves can loop around, the distance function can have multiple local minima ...
1
vote
2answers
193 views

Heron's formula for area of a triangle [closed]

Use the first form of Heron's formula to give a function areah, which gives the area of a triangle. Test your answer on the isosceles triangle ...
5
votes
0answers
82 views

Is there something like MaxProcessorUsed?

For standard procedures it is easy to test if the implementation is better or worse than other by using Timing etc. It does not help us with creating ...
7
votes
2answers
1k views

How to study asymptotic behavior, built-in functions

My question is as follows. Suppose we have a function $f(r)$ and we want to study its asymptotic behavior at infinity ($r\rightarrow \infty$). For example, the function may reduce to $-\frac{a}{r}$ or ...
13
votes
6answers
1k views

Counting negative values in list

I would like to count the negative values of a list. My approach was Count[data, -_] which doesn't work. How can I tell Mathematica to count all numbers with ...
0
votes
1answer
211 views

How to combine two usages of # into one and speed up the code?

I have a function num with two variables, matf and matg. How can I combine the last two lines of code below into one? The code is aimed to find out the maxiaml count bel when we give each $i3 = ...
0
votes
4answers
56 views

Don't understand why Do-loop index is not evaluated in Play expression

So here is some weird behavior: When I create a list inside a loop whose elements are Play functions, with arguments that depend on the counter, it is as if the counter is being stored symbolically, ...
1
vote
1answer
180 views

function returning 0

Why is my function returning 0? ...
1
vote
1answer
82 views

Issues with creating functions [duplicate]

Sometimes when I try to create a function inside a function, Mathematica gives me a hard time. I usually just have to play around with the syntax until it gets something it "likes" but I really have ...
5
votes
2answers
493 views

How to find the non-differentiable point(s) of a given continuous function?

For example, the non-differentiable point of the function $f(x)=|x|$ is at $x=0$. How to find the non-differentiable points of a continuous function that is defined numerically?
0
votes
1answer
939 views

Given x[u,v], y[u,v], and f[x,y] how do I find D[f,x] in terms of u,v?

I have two functions x = x(u,v) and y = y(u,v). The chain rule says that for a function f(x,y), df/dx = df/du du/dx + df/dv dv/dx, and similarly df/dy = df/du du/dy + df/dv dv/dy. How do I get ...
14
votes
5answers
1k views

sprintf() or close equivalent, or re-implementation?

Is there a sprintf() command (some command that takes a printf-style format string and a list of values to insert into the ...
3
votes
1answer
66 views

What is the syntax to combine conditions and options? [duplicate]

How can a condition and an option be written on the RHS of a function? I.e. ...