Questions tagged [algorithm]
Questions about algorithms used or which might be used to implement a procedure known by name or loosely but not in detail. The subject of the question may be a procedure mentioned in the literature or a Mathematica built-in function
391 questions
2
votes
0
answers
120
views
Most efficient way to store set of numbers and manipulate them
I have a set of pairs of numbers {id, quantity}, which I store in the table tab; id takes discrete values, and ...
3
votes
1
answer
206
views
What algorithm(s) does `BoundingRegion` use?
BoundingRegion is also known as enclosing region or circumscribed region.
What algorithm(s) does BoundingRegion use?
Below links ...
3
votes
0
answers
68
views
Implementing DC Decomposition of Nonconvex Polynomials Using Algebraic Techniques (Hall's Formulation 5.6) in Mathematica?
I'm working on implementing a difference-of-convex (DC) decomposition for nonconvex polynomials, following the algebraic approach described in Georgina Hall's thesis "Optimization over ...
17
votes
3
answers
1k
views
How to obtain the frontier of a 2D Brownian walk?
Given the definition: The frontier of Brownian motion is the boundary of
the unbounded component of the complement of Brownian motion.
Graphically, the frontier is in red:
How can one isolate the ...
0
votes
0
answers
190
views
How to find the exact optimal bound
Is there any way to fix or revise this code to find the EXACT optimal bound, and could anyone help find the EXACT optimal bound? Thanks.
...
1
vote
1
answer
94
views
Apply an equation based on two sets with different indexes
Apply an equation based on two sets with different indexes
Simple example
If I have the following elements in the form of two sets with different indexes:
$m=\{m_1,m_2,m_3,m_4,m_5\}=\{1,2,2,2,1\}$
$p=\...
9
votes
8
answers
905
views
Numerical approximation of the integral by using data
I want to use the numerical approximation of the integral of a function given a list of data:
$$\int_a^bf(x)dx\approx\sum_{k=1}^N\frac{f(x_{k})+f(x_{k-1})}{2}(x_{k}-x_{k-1}),$$
where $f(x_0)=f(a)$ and ...
3
votes
2
answers
744
views
Recycle buying soda problem
there is a question:
"
If a bottle of soda costs \$1 and you can exchange two empty bottles for one soda, how many sodas can you drink with \$20
"
...
1
vote
0
answers
110
views
Sum of disjoint product of sets [closed]
If we have the following sets and we need to apply the Sum of disjoint product property to them, as in the following example:
Take: $$P_1=\{x_1 x_4\}$$
$$P_2=\{x_2 x_5\}$$
$$P_3=\{x_1 x_3 x_5\}$$
<...
1
vote
1
answer
80
views
Performing logical reasoning to find minimum function between two functions
Consider the following two expressions:
f[x_,y_] := (1+x)
g[x_,y_] := (1+x*y^2)
x,y are bounded in a unit hypercube. (Ignore ...
10
votes
5
answers
1k
views
How can I get samples of f(x) that are roughly evenly spaced?
I am looking for an efficient way of getting 60 to 80 samples of an arbitrary f(x) such that the distance between adjacent samples are approximately equal. My first attempt is based on a first order ...
2
votes
1
answer
183
views
Efficiently Finding Weighted Integer Partitions
Suppose we have some list of natural numbers $\{ 1, 2, \dots, N \}$ and each natural number $i$ has a 'weight' $w_i$. I would like to generate the all the integer partitions which satisfy the ...
5
votes
2
answers
300
views
Minimum/optimal number of tiles to cover all boxes
I have been struggling with the following problem.
Given:
the coordinates of a bunch of boxes/rectangles (in the form {xmin,ymin,xmax,ymax}) aligned with the x-y ...
5
votes
4
answers
501
views
An accumulated moving average
1. Problem statement
In accordance with the standard definitions the inbuilt MovingAverage
...
5
votes
2
answers
255
views
Fill a sequence containing missing values
Example data
list = {Missing[], Missing[], 100., 200., Missing[], Missing[], 250., 210., Missing[]};
With downloaded data I often have the situation that there are ...
5
votes
5
answers
696
views
Analyzing football games (pairing matrix)
I want to cross-tabulate football games over several years.
Setting up example pairings:
Please note that there can be up to 20 clubs and a couple of thousand matches!
...
10
votes
9
answers
772
views
Partition a random sequence composed of three numbers
I want to partition an array composed of 1s, 2s and 3s in such a way that,
going from left ...
7
votes
6
answers
483
views
Replace duplicate list values with unique elements
My request is a follow-up on this question:
Replacing duplicates instead of deleting them
What if we want to replace duplicated values not with a single value but with newly created values distinct ...
4
votes
2
answers
212
views
Extract terms containing symbols
I would like to be able to extract terms that contain a symbol expression and leave the special function alone.
I have a list:
...
1
vote
0
answers
168
views
Solving system of linear equations in specific order
I know how to solve set of linear equations using Solve, or by hand of course. However, my current problem requires me to solve the equations in a specific order, ...
1
vote
1
answer
68
views
Unable to apply Reduce to a variable number of inequalities (obtained by InputFields)
I'm new to Mathematica and I'm stuck on this piece of code.
The code is supposed to let the user choose how many inequalities (in a number between 1 and 5) they want to be evaluated.
...
3
votes
1
answer
250
views
On the solution of systems equations with exact coefficients
It all starts with the following system of equations that I can't solve by hand:
...
5
votes
1
answer
137
views
How to Find a Weighing Matrix of Size n?
Weighting matrices appear in the statistical design of experiments (Weighting Matrices and Statistical Design of Experiments.
A weighting matrix is a generalization of Hadamard matrices, e.g.,
...
2
votes
2
answers
266
views
How can I calculate complicated infinite sums with FindIntegerNullVector (or related methods)?
I've recently been very interested in the wonderfully complex world of Euler sums, i.e. (convergent) infinite sums that, roughly speaking, consist of some rational polynomial combination of ...
2
votes
3
answers
211
views
Iterative method for fixed point of a mapping with domain and range contained in $\mathbb{R}^{2}$
Let $X$ be a metric space and $T:X\rightarrow X$ be a function. A point $x\in X$ is called a fixed point of $T$ if $x=Tx$. For example, if $X=[0,1]$ and $Tx=\frac{x}{2}$ then $T$ has a unique fixed ...