Skip to main content

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).

Filter by
Sorted by
Tagged with
2 votes
2 answers
216 views

I'm implementing a type conversion routine for a programming language. Under arithmetic context, there can be 4 types: null, ...
DannyNiu's user avatar
  • 307
0 votes
1 answer
31 views

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 ...
Jared Kosiba's user avatar
0 votes
0 answers
51 views

I would like to consider a rocket impulse plan from Earth to Mars for my Personal Project (IB-MYP) I am currently working on, and I am a student in high school in Hiroshima, Japan. Could you please ...
Pickles's user avatar
0 votes
0 answers
79 views

I am currently working on a Fortran codebase for numerical simulation, I have managed to simplify some loops to the following code ...
Eduard Occhipinti's user avatar
2 votes
1 answer
112 views

The context of this question is a competitive programming contest that occurred in July 2025. Solving this would allow me to understand the solution posted here. Indeed, that would allow to prove &...
FluidMechanics Potential Flows's user avatar
1 vote
0 answers
69 views

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 ...
Nishchala Mukku ee24s004's user avatar
2 votes
2 answers
117 views

Setup to the problem: We are going to determine the stationary points of the function $5x^3 - 3yx - 6y^3 - 2$ in the region $-1 \leq x \leq 1, \ -1 \leq y \leq 1$. Calculate the gradient $\nabla f(\...
Sien's user avatar
  • 407
0 votes
1 answer
104 views

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 ...
Andreas Christophilopoulos's user avatar
1 vote
1 answer
89 views

I have a question regarding training HMM and then applying it to new data: Is it possible to train a HMM with several time series as inputs? My point here is that it'd be convenient to have a ...
Kate Vedennikova's user avatar
0 votes
2 answers
145 views

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 ...
clebbf's user avatar
  • 1
2 votes
1 answer
65 views

I have a function in javascript that is supposed to calculate the nth prime. ...
SoggySocks's user avatar
0 votes
2 answers
160 views

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} ...
fragileradius's user avatar
5 votes
1 answer
113 views

This question is inspired by leetcode. Obviously, this is a math website, so I will ask math questions. Given an integer $n\ge 1$, consider the set of all sequences with elements in the range $[1, n]$...
pierrecurie's user avatar
3 votes
2 answers
294 views

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)...
dnn25519's user avatar
  • 741
1 vote
1 answer
109 views

I'm trying to read Anne Kaldewaij's book Programming: The Derivation of Algorithms and he begins the first chapter on "Predicate Calculus" with: In programming, predicate logic is used as a ...
byron perez's user avatar
1 vote
0 answers
53 views

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 ...
Chris Sherlock's user avatar
0 votes
0 answers
66 views

I'm working on a web application which uses fabric.js to make drawings on the web page's canvas. I will tell you about some general properties of this tool for context: Canvas is a space that has its ...
M. Çağlar TUFAN's user avatar
0 votes
0 answers
54 views

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 $...
ayaan098's user avatar
0 votes
0 answers
87 views

I am working on a problem where I need to analyze a small sorting program using Hoare logic to formally verify its correctness. Here's the program: ...
asfasfasf's user avatar
1 vote
1 answer
180 views

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 ...
Benjamin Danger Johnson's user avatar
11 votes
1 answer
530 views

I have enjoyed playing a puzzle game called "Cats & Boxes" published by Smart Games. Briefly, the way the game is played is: Place $5$ cat pieces and $4$ box pieces (one of which has $2$...
DreiCleaner's user avatar
  • 2,250
0 votes
0 answers
45 views

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 ...
user avatar
2 votes
1 answer
115 views

A while back, I noticed an interesting identity that exists between two particular numbers, involving a cyclical shift of one number when represented in base $16$, so that it's equal to the cycled ...
Amit's user avatar
  • 615
2 votes
1 answer
92 views

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 ...
Nate's user avatar
  • 1,881
1 vote
0 answers
255 views

I apologize if this question is not appropriate for this platform. I am working on specific problems involving elliptic curves and am looking for numerical examples. The LMFDB database has been quite ...
Hetong Xu's user avatar
  • 2,315
1 vote
1 answer
70 views

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....
Yohannes Kifle's user avatar
0 votes
0 answers
30 views

Suppose we have a nonlinear feasible set $F$ in $\mathbb R^8$ given by all $(x_{11},x_{12},x_{21},x_{22}, y_{11},y_{12},y_{21},y_{22})$ satisfying $x_{ij},y_{ij}\geq 0$ and $x_{ij}^2+y_{ij}^2\leq 1$, ...
sam's user avatar
  • 131
-3 votes
1 answer
109 views

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 ...
Daylily's user avatar
1 vote
1 answer
97 views

$\newcommand{\llbracket}{[\hspace{-0.5mm}[}$ $\newcommand{\rrbracket}{]\hspace{-0.5mm}]}$ $\newcommand{\sem}[1]{\llbracket #1 \rrbracket}$ I came across the paper Notions of computation and monads by ...
MB7800's user avatar
  • 105
0 votes
0 answers
75 views

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 ...
Avana's user avatar
  • 1
3 votes
1 answer
283 views

As far I understand it correctly, GF(Integer) is used to declare a finite field which can for example be used for declaring an elliptic curve (this is what I want ...
user2284570's user avatar
0 votes
0 answers
89 views

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 ...
Sonu Gupta's user avatar
1 vote
0 answers
75 views

I'm trying to code a Scratch project where you can place two (or more) points in a Poincaré disk to create hyperbolic lines. So far, the engine is going pretty well, but the actual line in between the ...
Path to Math's user avatar
1 vote
1 answer
150 views

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 ...
pie's user avatar
  • 9,401
3 votes
1 answer
115 views

Sets that are defined inductively can only contain elements that finite in size (e.g., length, height, space). This can be intuitively proven by realizing that any element in such a set can be ...
Moonlit's user avatar
  • 33
2 votes
0 answers
131 views

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, ...
James Sarantidis's user avatar
4 votes
5 answers
1k views

Lately, I've been finding that I often need to compute various things and graph some pretty complicated functions. I've realized that learning to program, especially in Python, could be really helpful ...
Mathematics enjoyer's user avatar
0 votes
0 answers
85 views

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 ...
The Bosco's user avatar
  • 1,985
2 votes
1 answer
99 views

I'm working on a problem where I have several sets of numbers and I need to find the closest average for a set of target values by combining numbers from these sets. For example, let's say I want to ...
4DBug's user avatar
  • 21
0 votes
1 answer
62 views

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 ...
Truls Henriksson's user avatar
2 votes
2 answers
255 views

I am reading Tao's Analysis I, and there are a number of passages which seem to suggest an object-oriented point of view of mathematics reminiscent of the object-oriented programming with which I, as ...
Princess Mia's user avatar
  • 3,162
0 votes
0 answers
60 views

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 ...
vallev's user avatar
  • 1,101
1 vote
0 answers
58 views

I came across the following simple programming question: You need to create a boolean function that will return True if you get String A by shifting the alphabets in String B. Example: ...
moe asal's user avatar
  • 123
12 votes
6 answers
2k views

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 ...
Sersawy's user avatar
  • 335
7 votes
4 answers
2k views

I don't know if I have an odd question, or if this has been asked before (research has not provided me with an answer or question about this). But I have a large amount of summation I need to do, ...
DaisyLlife's user avatar
1 vote
1 answer
89 views

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)...
Xerix's user avatar
  • 113
1 vote
2 answers
52 views

I'm trying to calculate the degrees of an angle and the length of the hypotenuse if they were stretched/scaled horizontally or vertically. Here's a picture to demonstrate. a = width b = height c = ...
SamYazo's user avatar
  • 43
2 votes
0 answers
136 views

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 ...
Dmitri Scheglov's user avatar
1 vote
0 answers
31 views

Previously I had the following coefficients in the program. In this program I want to create a transfer function of butterworth approximation (Figital Filter Fesign - Digital Signal Processing). ...
SKevinAR18's user avatar

1
2 3 4 5
15