Linked Questions

4 votes
2 answers
150 views

How to apply a function to an expression? [duplicate]

What is the name for the function #1[#2]&? I would call it Apply, so that Apply[Sin,2] ...
Yrogirg's user avatar
  • 533
2 votes
0 answers
53 views

Folow-up on combining pure functions [duplicate]

This is a follow-up to this question. Consider: f = #^2& g = #^3& Compose[f, g] (#1^3 &)^2 Am I the only one to think this is a bug?
Igor Rivin's user avatar
  • 5,134
77 votes
3 answers
6k views

when is f@g not the same as f[g]?

I have always thought that f@g will give the same result as f[g] in all cases, and it is just a matter of style which one to use ...
Nasser's user avatar
  • 150k
33 votes
4 answers
2k views

What tools can help in realizing tail recursion?

I had nice discussions with Leonid and Rojo that got me interested in tail recursion. Tail recursion is not always easy to realize with Mathematica, so it would be nice to have some tools to help with ...
Jacob Akkerboom's user avatar
18 votes
4 answers
2k views

Cleanest way to take a[b[c]] to a[b][c]

As indicated in the title I'm looking for the fastest way to transform a[b[c]] into a[b][c], and the natural generalization to ...
b3m2a1's user avatar
  • 47.1k
14 votes
5 answers
575 views

Apply multiple functions to parts of a nested list [duplicate]

data = {{1, a, x, "one"}, {2, b, y, "two"}, {3, c, z, "three"}} I want to apply a list of four functions {f, g, h, m} one ...
Athanassios's user avatar
  • 1,301
6 votes
2 answers
580 views

Building conditional lists with Manipulate

I'm trying to select elements of a list that satisfy some criteria using Manipulate[]. Given 2 lists: ...
Sos's user avatar
  • 2,188
0 votes
2 answers
77 views

Sorting a list of pairs under a given function

If I have a list p={{15/16,1/4},{3/4,13/64},{3/4,1/4},{3/16,1/64},{3/16,1/16},{0,1/64}} I apply a function ...
Uswadkar Prashant Vasantrao's user avatar
1 vote
1 answer
193 views

Substitute complex functions into complicated polynomials

Mathematica has some strange way of sorting terms. It seems that it is using a canonical sort on expressions, e.g. $\mathbb{i} \sin[x] \cos[y] \cos[z]$ is returned as $\mathbb{i} \cos[y] \cos[z] \sin[...
Rainer's user avatar
  • 2,951
1 vote
1 answer
140 views

Compute Mean and Variance for Random Choice

I have data ...
SAAN's user avatar
  • 627
1 vote
0 answers
42 views

Is Construct introduced to replace Function application? Should it be treated as such an alternative?

I noticed that v.11.3 got released the other day; it was exciting so I went through the Summary of New Features in 11.3 to catch a glimpse of what's new and see if there is something I should keep in ...
user42582's user avatar
  • 4,225