# Tagged Questions

Questions about Mathematica's functional programming style, including the use of pure functions (Function[], #, &) and functions such as Map, Apply, Nest, and Through.

626 views

### How can I trace a functional expression's evaluation visually?

Ok, so the goal is to visualize the execution of this expression foo /@ {3 + 1, bar /@ {1 + 2, {4 + 7}}} in the following fashion using nested rectangles with ...
313 views

There seem to be lots of papers discussing the functional programming paradigm terminology for Haskell, such as monad, category theory, lambda calculus, *morphism, etc. People study concepts and ...
180 views

### How best to simulate n-body systems in a functional way

I want to simulate a N-body system in the most functional way possible. The system I'm modeling are metallic colloidal particles in a solution of peroxide water, as here http://arxiv.org/pdf/1502....
71 views

### RealDigits and functional style

So while thinking about Replacing numbers of which you only know certain digits I have faced, again, a problem that I find hard to extract from RealDigits' output ...
86 views

### Delimited Continuations: Easy? or Fundamentally Difficult?

Apologies in advance for the length of this question, but this is as short as I have been able to make it. The Prescription I'm looking at the following tutorial on delimited (or composable) ...
148 views

### DownValues for Built-in Functions

N.B. I have bitten the bullet, and I am going through Leonid Shifrin's "Mathematica Programming: An Advanced Introduction." (Which needs no introduction in this forum) One question I have: could one ...
50 views

### Different ways to program a recursive algorithm

Construct f (a numeric function) which takes multiple arguments with the following property: The single argument case $f(x_1)$ is meaningless, and the two-argument ...
81 views

### What are the differences between these functions when used for NMaximize?

In short, the question is how to construct the function you want to optimize? ...
89 views

### Updating procedural fitting algorithm to more efficient style?

For some time now, I have used this procedural programming approach to fit data in my research that is too cumbersome for the built in Mathematica functions. (Although this simple example works fine ...
136 views

### Finding Values of All Nine Constants in q-hypergeometric Equation

I suspect that an identity of the form $$\sum_{j=-n}^{j=n}(-1)^jq^{j(5j+1)/2}=\sum_{r=0}^{n}f_{ar+bn+c}(-1)^{n-r}q^{(n-r)(dr+en+f)/2}\frac{(q;q)_{gr+hn+j}}{(q;q)_{n-r}}$$ for $a, \dots , j$ integer ...
106 views

### Is it possible to change to a functional approach in this game-based procedural algorithm?

First of all, I'm aware that Mathematica StackExchange prefer specific questions, not discussions, but I need some enlightenment with this issue for I have nowhere else to ask :) The thing is, our ...
105 views

### Optimized subset algorithm implementation

I was reading a paper from Mathematica Journal.It mentions a code for calculating subsets. ...
58 views

### Strange sharp spikes causing overflow while doing gradient descent

I am trying to find a function h(r) that minimises a functional H(h) by gradient descent. The result of H(h) is a single number. (Basically, I have a field configuration in space and I am trying to ...
I need to find $h_{0j}$ for every $1\leq j\leq300$, where \begin{multline*} h_{0j} = \sum_{q=1}^{Q}g_qe^{-\lambda_q j\Delta}\frac{e^{\lambda_q\Delta}-1}{\lambda_q} + \sum_{p=1}^{P}\frac{e^{-\alpha_p j\...