Questions tagged [programming]
For mathematical questions related to programming, and questions where a computer-aided solution is strongly suggested. A strong connection with a mathematical topic is needed to make programming questions on-topic. This should not be the only tag. Consider also using the tags (algorithms), (numerical-methods), or (linear-programming).
725
questions
1
vote
1
answer
27
views
Schedule recurrent tasks to match a desired frequency?
I'm trying to write a small task scheduling function that takes a list of tasks, each with an assigned priority. These tasks are meant to update some values in a database, and some need to run more ...
0
votes
0
answers
49
views
Calculating $ \sum_{k=1}^n \lfloor k * \sqrt 2\rfloor $ [duplicate]
This is a programming question I've come across recently and it requires me to find this sum as quickly as possible since n can become very large (up to 10100 ...
0
votes
1
answer
43
views
Why are such two methods functionally equivalent from a mathematical perspective?
To program a function that tests whether all elements in an array are greater than 5, the straightforward way will be:
...
1
vote
1
answer
119
views
Numerical integration improves when step size is smaller, but in which direction?
I am implementing a double integration of a function; numerically in Matlab.
What I basically do is:
...
0
votes
1
answer
67
views
Modular square root function with Hensel's Stronger Lemma; algorithm for $\bmod 2^x$? Also $x^2 = a\pmod{p^n}$ when $\gcd(a,p) \neq $1
I'm programming a solution to HackerRank's Project Euler 100, which is a much stronger variant than the original question, so I have to essentially make a quadratic solver, which involves a lot of ...
0
votes
0
answers
28
views
How to derive the formulas of the spin-weighted spheroidal eigenvalues (2.16a)-(2.16g) in arXiv:gr-qc/0511111?
I am reading the article "Eigenvalues and eigenfunctions of spin-weighted spheroidal harmonics
in four and higher dimensions", which is on https://arxiv.org/abs/gr-qc/0511111.
I want to ...
2
votes
0
answers
28
views
Effective algorithms for finite lattices of (higher-order) monotonous functions?
I am looking for references on effective algorithms on finite lattices or posets, and in particular on lattices of monotonous functions between two lattices, with higher-order structure -- monotonous ...
1
vote
0
answers
70
views
Is there an algorithm for finding every isolated singular point on an algebraic variety, or a programming language that implements this?
Suppose one wishes to test if a given algebraic surface f(x,y,z,w) = 0 in projective 3 space has singular points, that is df/dx = df/dy = df/dz = 0, and one also wishes to calculate these singular ...
1
vote
1
answer
211
views
Is it possible for integer division in C++ to express a compact mathematical condition, as for Euclidean division?
I am studying integer division in C++. At the same time, I read the wikipedia article 'Euclidean division'. In this article there is such a lemma:
...
0
votes
1
answer
146
views
Calculate position of bouncing ball based on arbitrary time value
Usually, when you make a bouncing ball in any programming language, you have an X and Y value that updates over time, as well as an x velocity and y velocity, whose signs flip when the ball hits the ...
1
vote
0
answers
45
views
How to generate tangles?
In my research I need to generate tangle diagrams for with small number of crossings ($\leqslant 10$).
By tangle I mean 2-tangle, that is an embedding of two arcs into a ball where endpoints of arcs ...
1
vote
1
answer
44
views
How does this code implement the gauss-siedel method?
I have been trying to port and understand the code used in the paper Real-Time Fluid Dynamics for Games. One function in the paper, the method to diffuse one of the vector fields is said to use the ...
6
votes
1
answer
458
views
Taxi distance count to all lattice points at specified distance from the lattice origin and of a specified dimensionality?
Setup of the problem
Description of the lattice
The problem is stated on a non-negative integer ($ℤ_{\ge 0}$) lattice.
The specification of distance is also a non-negative integer ($ℤ_{\ge 0}$).
...
5
votes
4
answers
1k
views
Does the set of all programs form a group that acts on machine state (essentially, i.e. with a few exceptions)?
Since the only thing a computer can do is modify its machine state, and you can always change from one state into another state (there exists such a program) and so each program is invertible; and if ...
0
votes
0
answers
55
views
Uniqueness of negative and positive digit representation of integers
The question is regarding to the python code for following problem. We consider two type of digits, negative and positive to represent integers in given base. We are presenting theorem (self made), ...