# Questions tagged [programming]

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.

1,533 questions
Filter by
Sorted by
Tagged with
11 views

### generate right triangles of different measures with an unknown data

Could you help me improve this code to generate at least 10 "slightly larger" right triangles, but instead of all the results that find an "x" on one of the sides and the type ...
• 181
93 views

180 views

### Enumeration of a certain sequence I

Denote by $a(n)$ the number of families $\mathcal{F} \subseteq \mathcal{P}(X)$ on a finite set $X$ with $n$ elements satisfying: $\emptyset, X \in \mathcal{F}$ For all $U, V \in \mathcal{F}$ it holds ...
56 views

### How can an algorithm be written in Mathematica language in a scientific paper? [duplicate]

I have a scientific research in which I used an algorithm in an optimized language to simplify the calculations, which is important and should be included in the paper. Algorithm ...
• 604
126 views

### Enumeration of a certain sequence II

Denote by $a(n)$ the number of families $\mathcal{F} \subseteq \mathcal{P}(X)$ on a finite set $X$ with $n$ elements satisfying: $\emptyset, X \in \mathcal{F}$ For all $U, V \in \mathcal{F}$ it holds ...
48 views

### How to select the outermost CellGroup that contains given cell?

Suppose we have a Notebook with a deeply nested structure (this is a simplified example, the Notebook can be huge): ...
• 60.3k
66 views

### How to find optimizers with computer in this kind of minimax problem

I have a minimax problem of the form \max_{\substack{u_1,\dots,u_n \ge 0 \\ u_1+\dots+u_n = 1}} \min_{\substack{v_1,\dots,v_m \ge 0 \\ v_1+\dots+v_m = 1 \\ v_{j_1} \le v_{j_2} \hspace{1mm} \forall (...
• 125
68 views

### What are some basic references for learning "box language" and further mathematica language customization techniques? [duplicate]

I'd like to be able to understand and write mathematica code that is able to customize in some way the output of mathematica in notebooks, for example. I believe I need to learn the so called ...
• 41
425 views

### Garbage collection for lexical closures

Mathematica is known not to garbage collect temporary variables in certain cases. I am particularly interested in the very useful programming pattern known as a lexical closure. A somewhat trivial ...
• 6,828
1 vote
54 views

### How can we call Mathematica functions from another server using the wolframscript Python library?

How can we use the wolframclient Python library to call Mathematica functions when Mathematica is running in an another server? For example, if we have Mathematica ...
• 1,436
34 views

### Does the Wolfram Cloud permit real-time Collaboration?

I am curious if anyone has found a workaround or directly built-in method to work collaboratively with colleagues? Something analogous to the google productivity apps like google docs where different ...
• 1,063
29 views

• 604
315 views

### How can I efficiently define functions with different names but doing the same stuff?

Recently I have met with with this interesting question:How can I efficiently define functions with different names but doing the same stuff? Somebody may want to ask me why I want to do things like ...
• 443
403 views

### Is there a more elegant solution than f[a, b, Sequence@@#3,...]?

I am trying to construct a list of many possible combinations using Outer and Permutations. Something that looks like that: <...
45 views

### How to use another algorithm when the first approach is too slow?

I need to write a program that uses an alternate algorithm when the algorithm first attempted is taking too long. Here is a minimal example. ...
• 6,768
42 views

### TagSetDelay the Plus[ ] function for direcy use with Datasets

I am trying to define a particular behavior of the function Plus[] when the arguments are $n$ Dataset, with $n\geq 3$. (The goal is to mimic the behavior of Plus[] with Datasets instead of numbers) ...
• 151
1 vote
114 views

### Finding the value of a Fibonacci Polinomial

I need to find the value different to 0 when evaluating Fibonacci[x,2]mod(8417525)=0 How can I set up that with an iterative process, trying subsequent natural numbers till it finds the target value? ...
• 103
269 views

### Lazy vs strict evaluation approaches - performance comparison

In general, I think there are two methods of evaluating a variable in Mathematica. My question is about performance of the two methods. Suppose that our final goal is to evaluate ...
• 3,221
73 views

### Issue with the output of pure functions

I am getting the operator & in outputs of pure functions. e.g. with the following code ...
76 views

### Using FindRoot in a Loop: Updating the value of starting point

Consider the following nonlinear equation for $h[\lambda]$ ...
60 views

### My notebook backup function works fine. I am just asking for your critical review before submitting to FunctionRepository

Why the name and what does it do exactly? Youre probably asking yourselves why I named it NotebookBackupStack. All that is explained in ...
• 1,977
35 views

### how to delete a variable programmatically in a notebook from another notebook

how to delete a variable programmatically in a notebook from another notebook? c = b; I have already tried Remove[c] but ...
79 views

### Could anyone please help with defining a vector function of tons of variables?

Could anyone please help with effectively defining a vector-valued function of tons of variables so that ...
475 views

### What is the most efficient way to define a Loop until function?

Mathematica has the While function which is very convenient when we need to process some code until the attainment of a certain state (identified with a condition). ...
• 1,087
1 vote
107 views

### How to convert this Mathematica expression to another, as described here?

I am working on a function of which the core will consist of something like: ...
• 9,447
78 views

### How can I separate expressions in Module without suppressing output?

I want to show a progress indicator while statements in a Module are processed. Outside a Module this ca be done like this: ...
• 2,522
60 views

### Does ArgumentsOptions do anything we couldn't do without it?

ArgumentsOptions was new in version 12.2. I looked at the application on that page, and it makes code very difficult to understand. What if anything does ArgumentsOptions do for us that we couldn't do ...
• 6,768