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

1 vote
0 answers
47 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 ...
Turtle5's user avatar
  • 388
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 ...
Arin Bryan's user avatar
6 votes
1 answer
460 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}$). ...
user avatar
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 ...
SeekingAMathGeekGirlfriend's user avatar
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), ...
Pruthviraj's user avatar
  • 2,697
1 vote
0 answers
102 views

Optimization problem that is convex and bounded is said to be unbounded in implementation

I have an optimization problem that is convex and bounded: \begin{align*} \text{Minimize}_{\text{wrt} B_{\text{opt}}}\qquad &\frac{1}{2p\sigma^2}\|Y_{\text{opt}}-X_{\text{opt}}B_{\text{opt}}\|_2^2-...
Resu's user avatar
  • 816
0 votes
1 answer
66 views

Faster primality testing? [closed]

I have to make a list of primes, and I found out that all primes are of the form 6n+1 or 6n+5 (however not all numbers of this form are prime). Thus, I use it to find primes more quickly as such: <...
Mathematically Clueless's user avatar
2 votes
1 answer
140 views

Coding theory graduate text and programming

I begin a PhD in coding theory next fall, and it concerns coding over certain types of rings (e.g. finite chain rings) instead of fields, and in consequence submodule codes. I have a fair amount of ...
JBuck's user avatar
  • 743
1 vote
0 answers
59 views

What is the best way to manipulate probability expressions in code?

Suppose I want to write code to derive formulas using basic algebra and rules of probability theory (general multiplication rule, inclusion-exclusion, law of total probability, conversion to odds/...
user10478's user avatar
  • 1,922
0 votes
0 answers
310 views

Signed distance functions to arbitrary implicit surfaces

I am working on something called a raymarcher. It's a type of 3D engine, and a rather peculiar one; it uses a signed distance function to describe a scene, which is surprisingly enough info to ...
zenzicubic's user avatar
1 vote
1 answer
103 views

How to convert a point on a tilted 3D plane to a point on a 2D plane?

I have an infinite plane in 3D that I only know the normal vector of. I also have a point, somewhere on this plane. Based on the normal of the plane, its center point and the coordinates of the point, ...
GoogleCoder's user avatar
1 vote
1 answer
22 views

Intersecting two graphs of modulo functions with fractional coefficients

I'm currently working on something for audio programming and in order to avoid a long post i will boil the problem down to a mathematical one. I have one function of the form: ...
MaxOuwe's user avatar
  • 11
2 votes
1 answer
453 views

Ray-cone and ray-cylinder intersections

I am writing a simple raytracer, and I want to be able to raytrace capped vertical cone and cylinder primitives. I need to be able to find intersection points and normals for use in lighting and ...
zenzicubic's user avatar
0 votes
1 answer
76 views

my function is skipping

I wrote a function in C code that calculates a polynomial value from a given array arr[] of arrsize size, where the elements are ...
S. M's user avatar
  • 25
2 votes
0 answers
23 views

Algorithm for computing the collection of all string homomorphisms $f$ such that $f(s) = t$ for fixed strings $s,t$

I'm coding on a website in Django so all my code will be implemetned in Python. Anyway, I'm interested in the most efficient algorithm to compute the following problem. Given input strings $s = ...
Dev Joshi's user avatar

15 30 50 per page
1
4 5
6
7 8
49