# Search Results

Results tagged with Search options user 91
9 results

Questions on writing non-trivial programs in Mathematica. Do not use this tag for questions on plotting/graphics or for questions on doing mathematics with Mathematica, where the focus is more on the math than the program.

Represent the solution as a list $\{z_0, z_1, \ldots, z_9\}$. The counts of appearances of the various digits can be computed as appearanceCount[n_Integer, i_Integer, b_: 10] := Count[IntegerDigits[ …
answered Jan 7 '13 by whuber
The answer depends on the structure of the algebra. I therefore cannot give a universal answer. Instead, I will illustrate the structural dependence by means of examples. In response to the request …
answered Feb 29 '12 by whuber
The question invites us to perform the computation in steps: the presence of Range suggests--and indeed truly involves--20 loops. Each loop effectively computes the least common multiple (lcm) of …
answered Nov 9 '12 by whuber
When each $v_i = (v_{i,1}, v_{i,2}, \ldots, v_{i,k})$ is a $k$-vector we may interchange the summations to obtain \sum_{i=1}^{n-t} v_i\cdot v_{i+t} = \sum_{j=1}^k\sum_{i=1}^{n-t} v_{i,j} v_{i+t,j}, …
answered Mar 28 '13 by whuber
Cormullion's solution, which invokes built-in procedures MinDetect and MaxDetect, can be made to work in earlier versions of Mathematica than 9.0 using identically named (but differently functional) p …
answered Feb 19 '13 by whuber
If you want to be really nasty, traverse the entire graph (trying various vertices as starting points) and restrict the search for a shortest path to the traverse tree. Some of these will be quite lo …
answered Apr 10 '12 by whuber
We can substantially speed up the calculation for large primes by making some elementary observations about the Fibonacci series. There are two motivating ideas behind them: Almost all the propertie …
answered Jan 27 '13 by whuber
After an initial attempt with a Graphics-based solution, it became apparent that raster-based solutions would be far more efficient. Methods based on ArrayPlot work nicely, but I wondered whether ima …
answered Mar 25 '13 by whuber
Obtain the image: i = Import["http://i.stack.imgur.com/iab6u.png"]; Compute the distance transform: k = DistanceTransform[ColorNegate[i]] // ImageAdjust; ReliefPlot[Reverse@ImageData[k]] (* To ill …
answered Mar 5 '13 by whuber