All Questions
Tagged with mathematics python
202
questions
1
vote
1
answer
99
views
Solving roots of negative numbers
As part of an assignment for college summer classes, I was tasked with writing a program that solves roots of negative numbers. I've ran it through the test cases I was provided and it computes ...
8
votes
2
answers
535
views
Probability that Three Pieces Form a Triangle
I wrote some code to estimate the solution to the following problem:
If you break a line segment at two random points, what is the probability that the new line segments can form a triangle?
The ...
1
vote
1
answer
408
views
A Credit Payment Calculator
So I've attempted this project from hyperskills where you're asked to make a calculator script that can calculate annuity and differentiated payments given that 3 of 4 values are known. I think i went ...
1
vote
1
answer
135
views
Multiplying by certain elementary symmetric polynomials
Let me preface this with saying that it's probably not necessary to understand all the math behind this to review my code. Unless you have a lot of spare time or a very strong interest I also wouldn't ...
2
votes
1
answer
484
views
Graphing various mathematical functions in Python
1) This code's task is to create graphs of various algebraic, logarithmic and trigonometric functions and relations using Python's matplotlib.plyplot module. ...
4
votes
1
answer
312
views
Simulated annealing for magic square-of-squares puzzle
I'm working on a function that takes in a NumPy array containing only mutually distinct positive square numbers. I want the function to pick an element at random, find if there is a lower positive ...
5
votes
2
answers
3k
views
Python: Function to Find 2 Closest Points Among [x,y] Coordinates
I'm writing some code in Python that takes a set of [x,y] coordinates (in a list of tuples) and also an x-value. I need to find the two closest x coordinates to my x-value.
To find the closest x, I ...
3
votes
1
answer
311
views
Statistics Calculator for Listed and Grouped Data
I made a statistics calculator based on raw data for my Edexcel IAL Statistics 1 course which I'm going to use in my calculator's MicroPython. I would like some suggestions for ways to further improve ...
1
vote
1
answer
286
views
Python extended Euclidean algortihm + inverse modulo
I programmed the extended Euclidean algorithm together with the inverse modulo because I am making an RSA system from scratch. Any feedback regarding efficiency etc. is welcome :)
...
3
votes
2
answers
979
views
Extended Euclidean algorithm
I have programmed the extended euclidean algorithm. Is this a good approach?
...
1
vote
2
answers
128
views
Binary exponentation with modulo
I have implemented binary exponentiation. Is this good?
...
1
vote
2
answers
410
views
Monte-Carlo method to check triangle inequality
This is code for finding if inequality \$abc > 2(\text{area of triangle})\$
where \$a\$, \$b\$ and \$c\$ are the sides of any triangle.
The below, and repl, code work as intended. However they ...
1
vote
1
answer
2k
views
Linear Equation in Two Variables Solver using Python
I made this simple program that can solve every set of linear equations in two variables.
You just need to enter two linear equations of the form ax+by=c (without any unnecessary spaces) where 'a' is ...
0
votes
1
answer
167
views
Binomial Expander
So I made a Python program to solve some of my A-level binomial questions or just to let me check my answer overall. I need advice on how to make it more compact and simplify it.
This Python code is ...
3
votes
1
answer
61
views
A sequence/series formula solver
I made a formula retriever that works and allows importing of fractions.
This python code is meant for the fx-cg50 calculator's micropython, where there are a lot of functions that don't work ...