Questions tagged [computational-complexity]
The computational-complexity tag has no usage guidance.
31
questions
1
vote
0
answers
58
views
Complicated expressions involving hypergeometric functions
This is in relation to my last post which was unanswered but I think I may have found somewhat of a workaround. I have the following preliminary definitions
...
0
votes
0
answers
167
views
>100 GB of memory used by Reduce. Am I doing something wrong?
Newish to Mathematica here. I'm running some code to compute regions of the parameter space where the covariance between innovations is positive or negative. On my Windows PC, it's been running for ...
2
votes
1
answer
75
views
`SequencePosition` doing unnecessary work
SequencePosition returns only the first sequence in a list that matches a given pattern with
SequencePosition[list,pattern,1]
...
2
votes
3
answers
214
views
How to get rid of complex terms in the given expression and rewrite it as a real function?
I have an expression exp in terms of the parameter $n\in\mathbb{N}^+$ which takes the values
$n=\{ 1,2,3,4,5,6,7,8,9,10 \}$. As can be seen (a picture is also ...
0
votes
1
answer
206
views
Solve a system of complex equations with parameters
I have a system of ten complex equations, with four complex variables u1,u2,v1,v2 and two real variables θ1, θ2. In these ...
1
vote
0
answers
37
views
ParametricNDSolve computation time is sensitive to the range of independent variable
My code to solve a system of nonlinear differential equations are the following:
...
1
vote
2
answers
65
views
Find min value of a complex Root function [closed]
Could someone tell me how to obtain the min value of this function when lambda is between 0 and 1:
...
0
votes
1
answer
67
views
How solve this system of trigonometric equations?
I have the following system of equations:
(substituting any real values for a,b,c,r,Alpha,Beta will return the same answer for x)
...
0
votes
1
answer
97
views
Evaluation taking extremely long
I am trying to solve the following:
...
2
votes
1
answer
226
views
How to calculate the complexity of summation [closed]
I am trying to calculate the computation complexity of an algorithm and I have reached the following summation (that shows the number of operations) and I don't know how to find the Big O. (H is a ...
3
votes
0
answers
75
views
What's the time / space complexity of pattern matching?
For example, in ReplaceAll[expression, pattern], what are the main algorithms used internally? How does the asymptotic time / space complexity scale with the length ...
0
votes
1
answer
106
views
My plotting comes out to be gray not coloured using AbsArgPlot function in Mathematica. What is the reason for not getting a coloured graph??h
My graph comes out to be gray, not coloured using AbsArgPlot function in Mathematica. What is the reason for not getting a coloured graph or what I can deduce from ...
0
votes
0
answers
50
views
Handling large data generated by a script file (using parallelization in Mathematica)
I want to write a script file Script_file.m which I am going to run on a server and collect all the data in a file named ...
0
votes
0
answers
132
views
Numerical errors in compiled function involving real and complex numbers as output
I am trying to use the Compile command in Mathematica to reduce the computation time because of its fast execution within Mathematica and ability to use the ...
6
votes
4
answers
159
views
Check if list is singleton in sub linear time
A singleton is a list whose elements are equal. Some ways of checking this in Mathematica:
{Equal@@#&,
1==Length@Union@#&,
MatchQ[#,{x_ ..}]&}
I ...
1
vote
1
answer
31
views
Is there a better way : solutions to integer equation
I have the following code which solves for Integers the equation
$$a_1+a_2+a_3+a_4+b_1+b_2+b_3+b_4+c_1+c_2+c_3+c_4=tot$$
with
$$ -4<a_i\in \mathbb{Z}<4$$
$$ -7<b_i\in \mathbb{Z}<7$$
$$ -4&...
0
votes
2
answers
112
views
Computing a difficult integral which is taking too long
I am trying to solve the following code:
...
1
vote
0
answers
68
views
Speed up Multidimensional numerical integration
I have the following 9-D integral, where the domain of integration is a nine-dimensional hypercube of unit length. The problem is that Mathematica takes too long to evaluate this. Is there any ...
0
votes
0
answers
93
views
Minimizing computation time
I'm having issues with reducing the computation time of a NMinimize function. I've tried setting the WorkingPrecision and N and ...
1
vote
4
answers
178
views
How can one expand an arbitrary boolean combination into the $2^n$ atoms of the associated boolean algebra of size $2^{2^n}$?
The answer of user250938 to Can one usefully apply the Boolean functions of Mathematica to measurable Boolean sets? and the second comment of
Monroe Eskew to the answer to https://mathoverflow.net/...
0
votes
0
answers
142
views
Ways to decrease computational time?
I have created a 2D axisymmetric simulation of the motion of charged particles in an electric field. The electric field is created by a needle attached to a top plate both of which are at -3800V with ...
0
votes
0
answers
22
views
AsymptoticLess function confusion
I have an algorithm which complexity is:
...
2
votes
1
answer
280
views
Cutting digits of a number without approximation:
I am evaluating an exponential and I end up with the following result:
$1.4497788553129478854329$
Is there a command on Mathematica that allows me to cut my result without approximating it? I would ...
1
vote
1
answer
44
views
Finding ponts closer to each other than a given distance
As a working example let's assume that we are given a list of points in the unit square (say by RandomVariate[UniformDistribution[{0, 1}], {20, 2}]).
I want to ...
2
votes
1
answer
404
views
SparseArray: accesing nonzero row and column entries
I have an enormous $m\!\times\!n$ sparse matrix $d$ with $l$ nonzero entries, stored as d=SparseArray[{{i1,j1}->w1,...,{il,jl}->wl},{m,n}];.
How do I access ...
11
votes
3
answers
3k
views
Is there a way to do Quantum Computing in Mathematica notebook?
I saw 2 efforts in that direction: WSS17 and WSS16, but I am not sure if there is something in the latest Mathematica that actually allows users to simulate quantum gates.
Can anyone please point me ...
0
votes
0
answers
62
views
Why does this ArgMax take so long to compute?
I have the following code which is supposed to return me the arguments for $l1,k1$ that maximize the function $fsub$, subject to constraints. I need the answers algebraically as functions of the other ...
12
votes
2
answers
607
views
Simplify expression: overcome a barrier in the complexity function
I would like to simplify
x=n[a] f[b, a] + f[a, b]
using 2 rules
...
1
vote
0
answers
82
views
How maximaze very complex problem in a few hours using some server?
I need to execute a code that runs a maximize function built-in function with symbolic variables. The problem is that my computer has not enough memory (has 4 GB of ...
0
votes
0
answers
218
views
Finding Option Value in American Options
I want to find the Option Value in American Options. I basically want to replace this code if possible
...
3
votes
0
answers
46
views
Measuring space complexity? [closed]
I like using GeneralUtilities function BenchmarkPlot for estimating time complexities, is there something similar for ...