All Questions
Tagged with math or mathematics
649 questions
0
votes
0
answers
57
views
Computing \$k\$ most reliable paths in undirected probabilistic graphs in Java
Intro
(See MostProbablePath.java.)
This time, I elaborate on Computing most probable (reliable) path in a probabilistic graph (take II): instead of computing the most reliable path I now return \$k\$ ...
5
votes
6
answers
975
views
The Haversine formula in Java for computing distance along the Earth between two locations expressed in geographical coordinates
This time, I have implemented the Haversine formula:
io.github.coderodde.geom.Haversine.java:
...
11
votes
3
answers
1k
views
Golden-section optimization with complication
I'm trying to implement the so-called golden-section optimization in C++.
This is a simple algorithm to find an extremum of a univariate function \$f\$ within an interval \$[a,b]\$.
The crux is to ...
0
votes
0
answers
18
views
Mathematica implementation of Lempel method for constructing Costas arrays
I ported C++ implementation of Lempel method for constructing Costas arrays to Mathematica.
How to fix my code? Thanks in advance.
...
2
votes
3
answers
188
views
Calculating volume expressions of \$n\$ -dimensional balls in Java - follow-up 2
(See the previous iteration.)
This time, I have refactored my code a bit. It follows immediately:
Code
...
4
votes
2
answers
241
views
Calculating volume expressions of n -dimensional balls in Java - follow-up
Intro
(The previous/initial iteration is there.)
(The next iteration is there.)
This time, I have incorporated a nice answer by Martin R.
Updated code
...
4
votes
1
answer
343
views
Calculating volume expressions of \$n\$-dimensional balls in Java
(See the next iteration.)
Intro
This time I have a Java program that prints some expression denoting the volumes of \$n\$-dimensional balls. All the math behind this is there.
Code
...
5
votes
1
answer
340
views
Multiplying two large numbers whose digits you have in a string, in AEC compiled to WebAssembly
You can see it live here: https://flatassembler.github.io/multiplying-strings-aec.html
...
2
votes
0
answers
34
views
Mathematica implementation of Welch method for constructing Costas arrays
I ported C++ implementation of Welch method for constructing Costas arrays to Mathematica.
Any feedback would be appreciated.
...
6
votes
2
answers
457
views
(Codewars) Goldbach's Conjecture (by @rsalgado) in Ruby
Link to kata: linkRank: 6 kyuKata author: @rsalgado
I have been recently learning Ruby-lang and have been attempting to solve the following kata from Codewars involving Goldbach's Conjecture:
...
5
votes
2
answers
844
views
Bruteforce integer multiplication in Java
Intro
This time, I have attempted to prove the following bruteforce multiplication formula:
$$
(a_n \cdots a_0) \cdot (b_m \cdots b_0) = \sum_{i = 0}^n \sum_{j = 0}^m a_i b_j \cdot 10^{i + j},
$$
...
2
votes
0
answers
182
views
How to make this arbitrary precision π calculator using Machin-like formula run faster?
Two days ago (or yesterday depending on your timezone) was π-day. So I thought it was a good day to calculate π.
I used Machin-like formula to calculate π, in homage of William Shanks, who calculated ...
-4
votes
1
answer
379
views
int128 handling in C code, gcc / glibc / linux - follow up IV [closed]
[edit] Hint: a similar project for C++20 which - as far as I see - also manages bigger than 128-bit integers can be found at: Infinite precision integer in C++20 . [/edit]
I got lots of kind hints on ...
7
votes
2
answers
268
views
Two-Step Linear Equation Solver with Input Validation and Formatting
This code defines a function to solve two-step linear equations of the form coefficient * variable + constant = solution. It prompts the user for the coefficient, ...
11
votes
3
answers
1k
views
Computing π(x): the combinatorial method
This is my C++ implementation of Computing π(x): the combinatorial method by Tomás Oliveira e Silva. The math involved is elementary number theory, but fiddly and not the focus here. I have ...