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).
741 questions
2
votes
2
answers
211
views
Necessary and sufficient condition for a binary operation to be associative and commutative?
I'm implementing a type conversion routine for a programming language. Under arithmetic context, there can be 4 types: null, ...
0
votes
1
answer
30
views
Separating Axis Theorem for 2 arbitrary convex polygons. cannot work out how to make axis for projection, do projections from vertices for testing
i have watched numerous tutorials on implementing the SAT, but i think the math eludes me (as it usually does). Say, theoretically, that you are looping over each edge in a programming language, now ...
0
votes
0
answers
78
views
Rewriting a n-dimensional matrix of dot products as a matrix multiplication
I am currently working on a Fortran codebase for numerical simulation, I have managed to simplify some loops to the following code
...
1
vote
0
answers
69
views
Algorithms for factoring high degree polynomials
I have been reading the literature "Factoring very-high-degree polynomials" by G.A. Sitton, C.S. Burrus, J.W. Fox, and S. Treitel". This algortihm seems to be efficient for very high ...
0
votes
1
answer
104
views
Fitting general but "smooth" convex shape to points
I am aware that there are algorithms to fit, say, an ellipse to a bunch of given points on a plane. For instance, this SO question has answers which feature both literature on the algorithms and ...
0
votes
2
answers
143
views
I have a system of $6$ matrix equations, where the matrices are $64 \times 64$. How can I approach this problem in a more efficient way?
I think this question is more of a mathematics question rather than a programming question, read below for further details.
Goal
I have a system of somwehat big ($64 \times 64$) matrix equations of ...
0
votes
2
answers
159
views
What am I doing wrong implementing minimal residue method?
The given scheme $AU = F,$ where $A$ is an operator, and $U, F$ are the square $(N+1)\times(N+1)$-sized matrices. The action of operator $A$ is given by:
$$
-a \frac{U_{i-1,j}-2U_{i,j}+U_{i+1,j}}{h^2} ...
2
votes
1
answer
235
views
Project Euler: A Claim in Problem $759$
I am interested in problem 759 in Project Euler.
For those who don’t know, here’s the problem statement:
The function $f$ is defined for all integers as follows:
$$\begin{align}
f(1) &= 1 \\
f(2n)...
1
vote
0
answers
53
views
Functional programming and algebraic structures
I have been looking at algebraic structures (in particular groups) in functional programming. I have been fascinated by how monoids in particular have a wide applicability to the functional ...
0
votes
0
answers
53
views
Optimizing code to find optimal value of integer polynomial
I'm writing a Python program to calculate the maximum value of a polynomial $p * (1 + (d * (1 + (o * (1 + g))))$, subject to the constraints that $p$, $d$, $o$ and $g$ are all positive integers, and $...
1
vote
1
answer
173
views
Converting a Transform (position, rotation, and scale) from TouchDesigner Coordinate System to Unreal Engine's
I am trying to convert a transform from the Touch Designer Coordinate System to the Unreal Engine Coordinate System (and others).
Ideally, I want to take a position, rotation (in Euler angles), and a ...
0
votes
0
answers
38
views
A systematic way for constructing a set of die.
This is a problem from Knuth's The Art of Computer Programming, Volume 4B, Mathematical Preliminaries Redux. The problem is to find three six sided dice named $A$, $B$ and $C$ respectively, with sides ...
2
votes
1
answer
91
views
Good, fast-implementation algorithms for quotienting a finite-dimensional vector space over the reals with its subspace?
After doing a bit of digging, I can't find any native method in Julia's linear algebra package that let's me quotient a vector by a subspace. The Wikipedia article seemed to mainly focus on the theory ...
1
vote
1
answer
70
views
Deriving equation for a Dynamic programming Puzzle [closed]
I solved the following puzzle https://leetcode.com/problems/unique-paths/description/ here at leetcode using programming. It is not very difficult to reason about how to computationally get the answer....
-3
votes
1
answer
107
views
I was coding the other day when it occurred to me that it could be possible to program Bernoulli numbers. Is this possible, and how so? [closed]
I wanted to try and get the first 20 Bernoulli numbers using Python. Recently, I've been researching about Ada Lovelace, and Note G was an algorithm for the Analytical Engine to compute Bernoulli ...
0
votes
0
answers
72
views
Optimal Value t for Subdivision of Cubic Bézier Curve and How to Calculate It
In Gabriel Suchowolski’s paper, “Quadratic bezier offsetting with selective subdivision”, he explains how the midpoint—or better said, a parameter $t$ of 0.5—is often not the optimal* point on a ...
0
votes
0
answers
89
views
confused with the notion of probability
I understand probability as two processes;
We "do" something (or something is "happening"). lets call it the random experiment, and
We "expect" something from this ...
1
vote
1
answer
150
views
How to draw more precise of iterations in this type of constructions?
In this question I made this construction
Given a non-regular pentagon $A_1B_1C_1D_1E_1$ with no two adjacent angle having a sum of 360 degrees, from the pentagon $A_nB_nC_nD_nE_n$ construct the ...
2
votes
0
answers
131
views
Fractal Subdivision for Procedural Generation
This is my first attempt at creating a thread here, thus I'm not sure how much context I need to provide you. Please leave a commend if you need additional info. With that disclaimer out of the way, ...
0
votes
0
answers
85
views
How to solve a paths optimization problem in node-labeled and weighted graphs
I am having trouble finding a way to optimize this problem in Python. Even if it is not exact, I am trying some heuristics.
Let $G = (V,\mathbf{L}, E,\mathbf{W})$ be a graph where $V$ is the set of ...
0
votes
1
answer
62
views
How can I make a vector of the products of the elements $(a_0b_0,a_0b_1,a_1b_0,a_1b_1)$ from the vectors $(a_0,a_1)$, $(b_0,b_1)$?
Given the vectors
$$\bar{a}=\left(\begin{array}\\a_0\\a_1\end{array}\right), \hspace{5pt} \bar{b}=\left(\begin{array}\\b_0\\b_1\end{array}\right) \in \mathbb{R}^2,$$
is there any way to get the ...
0
votes
0
answers
60
views
Circular Breakout Game: time or collisions needed to reach nth layer
Shower thoughts...
A tiny ball starts inside a unit circle, surrounded by fixed concentric circles of increasing integer radius length. So it starts in is the 0-th "level".
The ball moves in ...
12
votes
6
answers
2k
views
Book recommendations for Combinatorics for Computer Science Students
I am a computer science student with an interest in competitive programming. I am currently looking to deepen my understanding of combinatorics, as it is a crucial part of algorithm design and ...
1
vote
1
answer
89
views
Find the center point of ellipse by only 2 points on it and radiuses
For a project, I am requested to find the center point of an ellipse (not necessarily centered), by just 2 points on it and radiuses.
B and E are points on an ellipse (Begin and End of an elliptic arc)...
2
votes
0
answers
128
views
Representing a Groebner basis decomposition in sympy
In Sympy package there is Groebner() function, which allows to find a Groebner basis={$g_1, g_2,..., g_k$} for an ideal I, generated by polynomials $\{f_1, f_2,..., f_n\}$.
I wonder if there is ...