20,347 reputation
357139
bio website
location Sydney, Australia
age 44
visits member for 2 years, 10 months
seen 7 hours ago

Moderator of Mathematica.SE and Celtic goddess.

Check out the Mathematica StackExchange Q+A site


Aug
17
comment how to efficiently apply function to all pairs of a set (and collect the results)
@michar - I find Tuples to be pretty quick: but note, it has n*n pairs - things like 2 -> 2 are possible, thus the self-loops in the picture above.
Aug
16
comment copy paste merging expressions
Welcome to Mathematica.SE, Amatya! I have formatted your post so it is a bit easier to read. If you would like to know how to do this yourself, this page explains how.
Aug
16
comment Strange behaviour of Reduce for Mod[x,1]
Welcome to Mathematica @ StackExchange! Please consider registering your account so that any upvotes you get on this question are added to those you might get on future questions and answers. That way, over time you will be able to do more on the site (post graphics, edit things, etc). Also, I have formatted your code to make it easier to read. This link will show you how it's done for next time. And welcome again!
Aug
16
comment How to align rotated tick labels?
Related: mathematica.stackexchange.com/q/4791/8
Aug
15
comment Is there a clean way to extract the subspaces invariant under a list of matrices?
Thanks for this thorough answer. I don't think there is a problem given that you have provided a Mathematica implementation. Is the expected output of the first block of code a tensor? Using A[j] matrices of random normal numbers, with $n=3$ and $m=4$ I get a 9*3*3 tensor.
Aug
11
comment Very fast way to do a coordinate frame transform
It might help to post the code, "ugly" or not.
Aug
10
comment Constructing lists by applying functions to another list
Also I formatted your code. You might want to read this page which shows how to do it yourself.
Aug
10
comment Constructing lists by applying functions to another list
What syntax errors did you get? It could just be that you were trying to assign to D which is a defined symbol already in Mathematica.
Aug
9
comment How to abort on any message generated?
Hi Ralph, thanks for the answer! I formatted your code for you. If you would like more information about how to do this yourself, have a look at this page.
Aug
8
comment Remove image background of headshot in Mathematica?
You can flag to have it migrated if you want. Your question is about programming so it is on topic on StackOverflow, but really any Mathematica-related question is better off on the Mathematica specific site now.
Aug
7
comment Why didn't Reduce give me the right result?
@Blanco - sort of like a lab notebook? It might be an ingrained habit in professions with rigorous government scrutiny of test results?
Aug
6
comment Word Squares and Beyond
I think there is actually a general solution involving Fold for word squares of different lengths, but I am getting myself confused with too much nested Slot notation. Maybe someone else wants to have a go.
Aug
6
comment Word Squares and Beyond
@VitaliyKaurov - haven't tried yet. I haven't thought of a way to generalise the above code, only to have separate cases for each string length. And I doubt word cubes can be done in only a few lines of code.
Aug
6
comment Word Squares and Beyond
@VitaliyKaurov there are four-letter words with no solutions, e.g. "ibex".
Aug
6
comment Word Squares and Beyond
Neat idea, but I can't help wanting to cite the StackExchange perennial: "What have you tried?". Also related: codereview.stackexchange.com/questions/12974/…. Wikipedia tells me that there isn't currently a known order-10 word square, so small order is as far as it goes.
Aug
5
comment Substituting Symbol font for Mathematica's custom font in exported plots and other graphics
@SjoerdC.deVries the difference is that SetOptions works for all characters that would otherwise be substituted (parentheses, +, - etc) without you needing to know which ones are substituted, and you don't have to change fonts by hand every time. But my Q&A pair is a nice hack for those times you need a Greek letter or an unusual symbol.
Aug
5
comment Substituting Symbol font for Mathematica's custom font in exported plots and other graphics
@SjoerdC.deVries - you can avoid these problems with SetOptions[Graphics,BaseStyle -> {PrivateFontOptions -> {"OperatorSubstitution" -> False}} . I am sure I had another question that covered this but I can't seem to find ti.
Aug
5
comment Adding Lines to Sparklines (plots w/o frames, axes, etc.)
@MikeHoneychurch It's just something I had lying around from ages ago.
Aug
3
comment Plotting best-response functions
I am not a microeconomist so I haven't worked on such things lately, but the non-convexity isn't needed. I was able to get a triple equilibria with this pair of functions: Plot[{Exp[-x - 0.25] + 0.1, Exp[-(0.9 x^(1/2))]}, {x, -1, 12}, PlotRange -> {0, 2}]. Their derivatives need to be equal at two points, so what you are looking for is convex functions (first derivative negative, second derivative positive) where the second derivative crosses.
Aug
3
comment Cut and paste data from a spreadsheet
This is correct but essentially replicates Sjoerd's answer. Nonetheless welcome to Mathematica.SE and thank you for your answer. Interestingly both Table and Range work in that third argument, but not Span.