All Questions
Tagged with numerical-methods functional-programming
5 questions
7
votes
2
answers
166
views
Simple function that simulates survey results based on sample size and probability
What is this:
This is a simple function, part of a basic Monte Carlo simulation. It takes sample size and probability as parameters. It returns the simulation result (positive answers) plus the input ...
10
votes
1
answer
1k
views
Generate iCalendar .ics files with events for astrological aspects
I'm relatively new to Python, coming from a deep C++ background. I'm mostly looking for feedback on how to make my code more idiomatic/pythonic, but I would welcome and appreciate any and all other ...
2
votes
0
answers
158
views
Computing nth roots of a number - SICP exercise 1.45
From SICP
Exercise 1.45:
We saw in 1.3.3 that attempting to compute square roots
by naively finding a fixed point of x/y does not converge, and that
this can be fixed by average damping.
...
3
votes
1
answer
129
views
Golden Section Search in Lisp
I implemented the golden section search algorithm recursively in Lisp. My code is:
...
1
vote
2
answers
780
views
Functional abstraction to find nth root of a number - Newton raphson
Below is the solution:
...