10,597 reputation
12276
bio website
location
age 43
visits member for 2 years, 8 months
seen yesterday

Sep
5
comment How to replace While construct to NestWhile(functional-style) correctly?
@Tangshutao: Anyway, I forgot: thank you for correcting my other mistakes (and I also forgot the @-attribution so you get notified).
Sep
5
comment Get a “step by step” evaluation in Mathematica
I just noticed that WalkD[Integrate[f[x],{x,g[x],h[x]}],x] results in an infinite loop of error outputs, each time adding an extra /. $Failed to the end.
Sep
5
comment How to replace While construct to NestWhile(functional-style) correctly?
I've now fixed the error in my code; my tests indicate it works now correctly. The error was rather stupid: I forgot to supply the initial argument and test function to NestWhile, and to close the remaining open function argument brackets.
Sep
1
comment Find the solution of A^2+AB+B^2 = f(a,b,c)
Since he wrote the equation in $\mathrm{\TeX}$, mathematical conventions apply, not Mathematica conventions. And in mathematical conventions, $AB$ is the product of $A$ and $B$. If a single variable had been meant, it would have to be written as $\text{AB}$. Try TeXForm[AB] vs. TeXForm[A B] in Mathematica (and remember, spaces in $\mathrm{\TeX}$ math mode are insignificant unless they separate a macro from adjacent letters).
Aug
27
comment Recursive function with array of variables
@kon: Indeed, that closing bracket was missing (reminder to self: don't skip testing, even for simple changes!). Thank you for noting, and for the accept.
Aug
26
comment Recursive function with array of variables
@TeakeNutma: I've now added both. Thank you for noting.
Aug
23
comment ToExpression from commandline
OK, I now could reproduce the problem, except that for me it tried to connect to ":0.0" (which explains why my previous attempt to reproduce it failed; I tried on a computer where I was also logged in/running X locally, and thus connecting to :0.0 would not fail). Using strace reveals that it executes a front end at some time; I guess that's where the problem arises.
Aug
23
comment ToExpression from commandline
I can't reproduce this with Mathematica 8.0.0.0, neither with nor without X forwarding. In both cases I get x == 2.
Aug
16
comment Communication between local kernels
Just curious: Is there a reason why you don't use the parallelism features of Mathematica, using SubKernels? Those include easy-to-use functionality for information sharing.
Aug
13
comment Convoluting inverse square root with Gaussian
With Mathematica 8.0.0.0 I get ConditionalExpression[(Pi*Sqrt[x]*(BesselI[-1/4, x^2/(4*sigma^2)] + BesselI[1/4, x^2/(4*sigma^2)]))/(2*E^(x^2/(4*sigma^2))), x > 0]
Aug
13
comment Skipping over iterator values in a Table
@Radz: You're welcome.
Jul
21
comment What's the difference between Inactive and HoldForm?
But couldn't the effect of Inactivate also be achieved using Hold with SetAttributes[MakeHeld, HoldAll]; MakeHeld[a_[b___]] := MakeHeld[a][b]; MakeHeld[a_] := Hold[a]?
Jul
21
comment Why wouldn't ReplaceAll (/.) work with this list of number?
I prefer {1, 2, 3, 4} /. {2 -> 5}.
Jul
18
comment NMinimize gives an obvious wrong value
I notice that you minimize estimator[{l}, {1}], but then evaluate estimator[{l}]. looking at your definitions, the latter should not evaluate at all. Could it be that an earlier definition of estimator still is in effect besides your current one, and gets triggered by your test expression? (Type ?estimator to see all definitions Mathematica currently knows.)
Jul
18
comment Plot3D unable to understand input function
BTW, what do you get for f[1,0,0,1.,1.]?
Jul
18
comment Plot3D unable to understand input function
If pre-evaluation works, an easy workaround should be Plot3D[Evaluate@f[1,0,0,y,k], {y,-3,3}, {k,-3,3}]. While that doesn't answer your question, it might solve your problem.
Jul
18
comment What is the order of faces on a D20? How can I optimize the order of faces on a D-n?
Also note that for the use of a regular polyhedron as a die, it is completely irrelevant how you distribute the numbers, as long as each number appears exactly once (if it were not irrelevant, the die would not be unbiased to begin with). Indeed, taking into account possible biases, the usual opposite-side rule is the worst you can do; since the opposite side of the most probable result will be the least probable result, opposite sides should be as close as possible to minimize the effect of unintentional bias.
Jul
18
comment What is the order of faces on a D20? How can I optimize the order of faces on a D-n?
Accordind to the normal 6-sided cube-shaped die, as soon as you add the condition that opposite sides add up to 7, there are only two possible distributions which are mirror images to each other. Quite obviously this means that you'll not find a possible distribution that dos not have a vertex adjacent to 1,2,3 — which can also be seen quite directly: opposite to 1 is 6, so adjacent to it can only be 2 to 5. Now 2 and 3 are not opposite, thus they are adjacent. Since 1, 2 and 3 are pairwise adjacent, they share a vertex. And the opposite vertex then of course is shared by 4, 5 and 6.
Jul
18
comment What is the order of faces on a D20? How can I optimize the order of faces on a D-n?
I'd use Gather with "is parallel to" as criterion. That way you'd get a list of pairs, containing sites opposite to each other. Then you could use Transpose on that list, and then Reverse on the second element of the result. Then apply Join to get back to a single list. Then the positions in the list are such that the opposite sides have indices which add to the same number (namely $d+1$ for a D$d$), so you can just give each side its index in that list as number.
Jul
18
comment Opacity limitations?
(Unrelated: The image upload palette seems to no longer work — updating to the latest version didn't help. Anyone has an idea why?)