3
votes
2answers
170 views

How to create a recursive TreeGraph

How could I create a recursive tree graph, such as one defined by the following: A family of trees $T_n$ are defined recursively as follows, for all integers $n \ge 1$. The tree $T_1$ consists of a ...
6
votes
2answers
163 views

Apply an accumulative function to each column of a dataset

Given a dataset with many columns, how can apply a function (in this case Count[Missing_]) to each column? ...
4
votes
0answers
79 views

Smart use of ParallelMap over Plus

I'm looking for ways to speed up calculation of a integral with a many-terms integrant. The obvious way is to go in parallel. I was surprised, but for some tests integration by ...
1
vote
1answer
100 views

Accumulating elements of lists taking the criteria out of another list

In order to find the critical values for the significance of a discrete distribution, for example BinomialDistribution[20,0.6], i need a function which works on the ...
1
vote
1answer
200 views

Forcing solutions to avoid Root[]

I'm solving a system of ordinary non-homogeneous differential equations (4 equations). The solutions will include some algebraic equations solutions as known from text books due to the use of an eigen ...
0
votes
1answer
309 views

Plotting curves with different filling styles and gridlines? [duplicate]

Here's a plot of some lines with different styles of filling and one gridline displayed: ...
1
vote
0answers
170 views

Imposing constraints to NMinimize/NMaximize leads to wrong function values

I wrote a function that uses NMaximize to find certain parameters (using NelderMead simplex algorithm). My objective functional $J({x_i})$ is real-valued and its ...
40
votes
1answer
558 views

Random polyhedra walk

I would like to recreate ssch's random polyhedra random walk, which he posted in the chat. For convenience here it is again: This is my best attempt so far: You can download the notebook with ...
2
votes
3answers
209 views

Tooltip pointer in ParametricPlots

ParametricPlot[{ Cos[u]^v , u}, {v, 0, 1}, {u, 0, Pi/2 }, Mesh -> {5, 5}] ParametricPlot[Tootip[{ Cos[u]^v , u}, {v, 0, 1}], {u, 0, Pi/2 }] How to introduce ...
1
vote
1answer
71 views

RunScheduledTask and return the result

I created a task that removes itself when an external variable x,is changed: ...
0
votes
0answers
77 views

Optimising prime number test code

Is it possible to speed-up this code ? Also, It would be great if people could test this algorithm. I only have a Raspberry Pi to test it on, so I can't be certain it's not a strong probable prime ...
1
vote
3answers
226 views

How to sort the list of all possible 3-tuples of elements from list constrained by a condition?

I want to know if there's a way to impose desired condition on Tuple command output. I have generated a list of 3-tuple of elements from {1,2,3,4,5,6,7,8,9,10} ...
0
votes
0answers
44 views

Is association in mathematica ordered or not? [duplicate]

Does the association <|a -> 1, b -> 2, c -> 3|> in Mathematica have order or not? If I iterate the association multiple times, is it guaranteed that ...
1
vote
0answers
53 views

Combine nested list entries [closed]

I have a list with stock index data (which I load from a database) as follows: ...
0
votes
2answers
158 views

Compute expectation numerically

I want to compute this expectation numerically with Mathematica. I could not figure out how to solve it numerically. Could you please help me? $$E(x|p)=\sum _{i=0}^m \sum _{j=0}^m ...
25
votes
1answer
402 views

Mathematical morphology: removing text features from image, while keeping connectivity

I have this image of London's road networks. ...
2
votes
2answers
165 views

Exact Differentials

I just started using Mathematica so my apologies if this is a very basic question. I tried to find related questions on this forum but couldn't, so here goes. I have an equation, $\quad \quad dp ...
1
vote
2answers
132 views

How do I use ReplaceAll to replace strings of a specified form?

Why is "Xabcde" /. "X" ~~ e__ -> e "Xabcde" and not "abcde"
1
vote
1answer
111 views

Declare type in InputField

Is it possible to declare a type in InputFunction to only accept positive Integers as input? I know i can create an ...
9
votes
4answers
1k views

Verify Cayley-Hamilton Theorem

Consider the matrix: A = {{-1, -4, -2}, {0, 1, 1}, {-6, -12, 2}} Now, the characteristic polynomial is found: ...
3
votes
1answer
258 views

ContourLabels issues

The ContourPlot generated by ...
3
votes
2answers
165 views

Integrate and NIntegrate not the same

Why am I getting two different results here? ...
0
votes
0answers
83 views

Reduce does not work

(i*((1 - ((1 + j)^-n))/j)) - (i*t*((1 - ((1 + j)^-n))/j))*(1/((1 + j)^k)) + (1*(1/((1 + j)^n))) == 1 I want to use reduce for ...
5
votes
3answers
1k views

How to define a distribution that 90% of the time gives me 0?

This maybe a simple question, but I am just stuck with it. I want to do some simulation, say with 0.9 probability, I get a 1, and 0.1 probability get a 0. How would I do that? Where should I start? ...
0
votes
2answers
63 views

What would be the most efficient way of finding the first repeated term in Sylvester's sequence modulo the $n$th prime?

If a multiple of a prime, say 13, occurs in Sylvester's sequence, then Sylvester's sequence modulo that prime eventually gets stuck on a bunch of 1's, and ...
10
votes
1answer
241 views

Behavior of TimelinePlot with multiple datasets of associations

Bug introduced in 10.1 and fixed in 10.3 The following TimelinePlot behaves as I would expect: ...
0
votes
1answer
139 views
1
vote
0answers
74 views

How to plot three related differential equations in Mathematica? [on hold]

Eq1: $ \frac{1}{3\phi}=\left[\frac{x}{x+1}\frac{d^{2}}{dx^{2}}+\frac{2x+1}{(x+1)^{2}}\frac{d}{dx}\right]{\phi^{2}} $ Eq2: $ ...
6
votes
1answer
99 views

Why is CurrencyConvert so slow?

...
3
votes
1answer
104 views

Tree-like nesting of function

Is there an elegant way to nest a function in a similar fashion to tree graphs; i.e., create and follow branches until some criterion is met (until we reach a leaf)? An example: We want to ...
6
votes
3answers
477 views

Count elements of a list

Let's create a random list n = 100; data = Table[{RandomReal[{0, 2}], RandomReal[{-1, 1}]}, {i, 0, n}] Now we divide the $(x,y)$ plane into four sectors with the ...
4
votes
2answers
187 views

Draw and Quantity

I'd like to use Quantity in my graphics, but I can't figure out how to do it even for a very simple Circle. ...
6
votes
1answer
262 views

How can I subtract one surface from another?

I have one surface for which I have an analytical solution, and another represented by a list of 3D points. My question is: how can I plot the part of one that lies outside the other? The first ...
2
votes
0answers
113 views

Transforming/exporting text to image

I have a string in a .txt which I process as follow: ...
0
votes
1answer
138 views

Manipulating list based on Euclidean distance

I have an array of 101 matrices. Each matrix contains information like id, position (x,y,z), time etc about a collection of particles, looks like this ...
1
vote
1answer
112 views

Summing terms in Table

I have a table that looks like Table[m, {k, 10}, {j, k}, {i, j}] where, m is a square matrix that depends on the indices $i, ...
0
votes
2answers
88 views

What does CreateDirectory[] return?

Based on: CreateDirectory returns the full name of the directory it creates, and $Failed if it cannot create the directory ...
1
vote
2answers
386 views

ContourPlot: format numbers in contour labels and legend

Can you suggest me a simple way to specify custom display format (for example ScientificForm) for such large values in contour labels and legend please? Thank you! ...
3
votes
1answer
165 views

White Lines in Contour Plot and 3D Plot

This is a follow up question to the original question here (has a solution). I am plotting another different total potentials and for this particular case the repulsive potential is a rectangle (open ...
0
votes
1answer
57 views

Execute code when it's saved [duplicate]

How do I execute code on save? This is a similar question: Running a package automatically when it's saved
1
vote
3answers
158 views

Plotting Intersecting Circles On A 2-D Plane

I am new to Mathematica and I would like to plot a number of circles all onto the same graph. I would like to visually observe which circles intersect each other. One constraint on all the circles is ...
23
votes
2answers
663 views

What is the difference between Composition (@*) and sequential applications (@)?

What is the difference between f@*g@*h@x and f@g@h@x Both evaluate to f[g[h[x]]] ...
8
votes
5answers
334 views

How can I tally continuous sequences in a list?

I have a stream of data like this: 0001100111100000111111001110000001111111111000000111000111110000... (I can represent them as a list, like in {0,0,0,1,1,...}, ...
0
votes
2answers
265 views

How to find critical points of trig function over an interval?

I need to find the critical points (maxima, minima and points of inflection) of the function $f(x)= \sin(x)+\ln(\frac{1}{4}x^2-\frac{1}{4}x+\frac{3}{2})$ over the interval $-3\leq x\leq5$. To do this ...
2
votes
5answers
167 views

How to convert string to integer list?

Saying we have a string: "1 2 3 4 5 6" I want to convert this to integer list. First I do: ...
2
votes
3answers
157 views

How to delete a pattern from String?

Having a string like : "{Aaaa -> a, Bbbb- > b, Cccc -> , Ddddd -> c, Eeeee -> , Fffff -> e}" I want to delete the parts that contain ...
-2
votes
1answer
64 views

Plot of a R -> R^2 fuction [closed]

I have an algorithm that when you insert the parameter B, the function gives a solution {x,y}. How can I plot that? I tried ...
3
votes
2answers
380 views

Length of a word

Probably my problem is very simple but I couldn't have found a solution to it anywhere else. How can I find a word of a certain length using a DictionaryLookup ...
15
votes
3answers
235 views

How to keep downloaded curated data

If I run StarData[], Mathematica will download the entire database from its server, which is quite a lot of data and takes some time: "Downloading entities ...
7
votes
0answers
133 views

How to get star coordinates for a given time

In the documentation of StarData, there is an example that shows how to get the altitude of Sirius at a given time (in the horizontal coordinate system). However, ...

15 30 50 per page