Reputation
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 32 90
Newest
 Nice Answer
Impact
~181k people reached

May
10
comment How do I draw a hemisphere?
One method (using RegionFunction) is shown here.
May
10
comment Can one identify the design patterns of Mathematica?
@Oleksandr Those are excellent points. Transforming a held expression is an idiomatic form of self-modification. I think it would be fair to subject such code to the same criticisms applied to all self-modifying code. Memoization, though, still seems to fall a little short of self-modification, because it is really just caching values. The relevant code itself is unchanged, although arguably the memoized object itself undergoes a (benign, controlled) form of "modification" in the sense of augmenting its collection of downvalues at runtime.
May
10
comment Can one identify the design patterns of Mathematica?
Not knowing what operation will take place is similar to not knowing (at compile time) what values the parameters will have, either. "Self-modifying" does not mean "unknown at compile time." Your example would be implemented in Assembly or C or their ilk using a dispatch table. Although the exact procedure will not be known until runtime, there is control over which procedures can be executed and in particular any procedure that might get executed has already been created before the execution started. During runtime, no code is actually modified.
May
10
comment Can one identify the design patterns of Mathematica?
It's powerful, yes, but I don't see how it is "self-modifying." Self-modifying code in MMA can be written but rarely is: it would consist of editing string expressions that would then be interpreted as MMA code and executed. What you discuss here appears merely to be the ability to pass almost any object as parameters, including objects that are thought of as executable. That has not historically been considered a "very bad thing" (although the dangers of such a thorough lack of typing are well known).
May
10
reviewed No Action Needed Exporting twice crashes Mathematica on Ubuntu 12.04 with Unity
May
10
reviewed Reviewed How can I get even steps on x and y axes in a plot?
May
8
comment Evaluation of a triple sum does not finish in reasonable time
Chris, my answer is incorrect: please accept the second answer by @b.gatessucks.
May
8
comment Evaluation of a triple sum does not finish in reasonable time
Very nice idea! @Michael E2 has clearly identified my mistake, which now squares our two results. (I promised only to find a lower bound for the sum, so a numerical value of the integral around $3.5$ is just fine). I apologize for making you work so hard :-) and will make up for it by transferring all the points from my answer to yours, which deserves it. (There's a day's wait before I can do that, though...)
May
8
awarded  Nice Answer
May
8
comment How to compare power towers in Mathematica?
@halirutan Nobody is responsible for deleting incorrect answers: signaling such problems is the role of downvotes. (On other sites, including math.SE, misunderstandings over this issue have created great amounts of angst among some people who have mistakenly accused moderators of not doing their jobs and have disparaged the communities. Please let's not foster such misunderstanding here.)
May
8
reviewed Reviewed How to flush machine underflows to zero and prevent conversion to arbitrary precision?
May
7
comment Finding max, min, and closest root of two dimensional data
You overlooked this, which may be more useful to you.
May
7
comment Multiplying two dimensional data by a constant
+1. Multiplying by a diagonal matrix is fast for up to somewhere between $100$ and $1000$ columns; beyond that, a solution modeled after Transpose[{1, 2} * Transpose[a]] becomes superior. Even better for such large matrices is a . SparseArray[Band[{1, 1}] -> {1,2}]; this is superior to both once there are $20$ columns or so.
May
7
comment Why can't I change the value of MaxRecursion in NIntegrate when integrating BesselJ?
Depending on your accuracy needs, approximate $\tanh(z)\approx 1$ for $z$ sufficiently large, such as $z\gg 20$. This works because $1 - \tanh(z)$ decays exponentially. The integral of $J_0$ can be evaluated in closed form, so numerical integration is needed only for the product of the Bessel function with $\tanh(z)-1$ from $0$ to this small threshold.
May
7
awarded  Nice Answer
May
7
reviewed Close why there is a small imaginary part
May
6
reviewed Close Scaled ColorData Function
May
6
comment Calculate variance of random walk?
Essentially all the work needed to solve this takes place in order to write it down in Mathematica. $Z_i$ has a Bernoulli distribution that is shifted in mean and rescaled. Its variance will therefore be the variance of a Bernoulli distribution multiplied by the square of the scale factor. One way to obtain the scale factor is by looking at the relative range: $(1-2k-(-1))/(1-0)=2-2k$. If you don't know the variance of a Bernoulli distribution you would then type Variance[BernoulliDistribution[p]](1-2 k-(-1))^2. $X_t$, being the sum of $t$ of these, will have $t$ times the variance.
May
6
reviewed Close Reversing axes to get Poiseuille profile
May
5
awarded  Sportsmanship