TheAlgorithms / Python

All Algorithms implemented in Python
https://thealgorithms.github.io/Python/
MIT License
192.6k stars 45.41k forks source link

We are lacking some algorithms from simulations #1613

Closed Vasuji closed 4 years ago

Vasuji commented 4 years ago

There are some interesting algorithms in simulation from Physics, Chemistry, and Engineering especially regarding Monte Carlo simulation: Heat Bath algorithm, Metro-Police algorithm, Markov Chain Monte Carlo, etc.

onlinejudge95 commented 4 years ago

PR is always welcome :) Do go through CONTRIBUTING.md before pushing your changes.

rakadkh commented 4 years ago

There are some interesting algorithms in simulation from Physics, Chemistry, and Engineering especially regarding Monte Carlo simulation: Heat Bath algorithm, Metro-Police algorithm, Markov Chain Monte Carlo, etc.

Hi 👋, I would love to contribute to this session, can you give some advices or tips on how can I do such?

onlinejudge95 commented 4 years ago

@rakadkh here are some simple steps.

  1. Fork this repo.
  2. Before adding your code make sure you have gone through CONTRIBUTING.md
  3. Add your code.
  4. Make sure your code is passing all checks provided in our .travis.yml file.
  5. Once you have pushed your changes to your fork and are ready to merge, please raise a Pull Request.
  6. Maintainers will provide additional review on your changes.
  7. Once approved your PR will be merged to master and you can pat yourself on the back 🤩
FatAnorexic commented 4 years ago

Time to write an algorithm or two.

cschuerc commented 4 years ago

I would like to contribute a Monte Carlo algorithm for the approximation of PI (see here). Of course, I would implement my own version. Is this okay?

cclauss commented 4 years ago

Go for it. https://github.com/TheAlgorithms/Python/issues/1613#issuecomment-565829640

naviji commented 4 years ago

I'll make a program calculating the probability of a particular sum of the throw of two dice using simulation.

naviji commented 4 years ago

I made it. https://github.com/TheAlgorithms/Python/pull/1759

danmurphy1217 commented 4 years ago

There are some interesting algorithms in simulation from Physics, Chemistry, and Engineering especially regarding Monte Carlo simulation: Heat Bath algorithm, Metro-Police algorithm, Markov Chain Monte Carlo, etc.

Hi Dibakar, I'm happy to help with the heat bath or Markov Chain algorithm if it is still not done. Let me know!

BokuAM commented 4 years ago

This looks like an interesting field to work in.

cclauss commented 4 years ago

Changing the name of this issue because we now have Monte Carlo algorithms but could use other simulation algorithms.

ghost commented 4 years ago

There are some interesting algorithms in simulation from Physics, Chemistry, and Engineering especially regarding Monte Carlo simulation: Heat Bath algorithm, Metro-Police algorithm, Markov Chain Monte Carlo, etc.

Show some

bbowles98 commented 4 years ago

I was thinking of contributing a Monte Carlo algorithm to simulate the game of craps, would this be ok?

cclauss commented 4 years ago

Would the algorithm be different than the others that already exist? https://github.com/TheAlgorithms/Python/issues/1613#issuecomment-605327601

bbowles98 commented 4 years ago

The algorithm wouldn't be much different, just used under a different scenario than calculating pi. Are there any algorithms in particular you are looking for?

Vasuji commented 4 years ago

Thank you so much, everybody, for the great contributions! In my opinion, optimization and simulation are two parallel arrows in computation. In general, we prefer to use simulation to go from mathematical models (e.g, Lagrangian, Hamiltonian in a physical system) to data generation (for example sampling through algorithms like Markov chain Monte Carlo). But, if we have very large data and we don't know the pattern (Mathematical equation or data structure(linear/nonlinear)), we prefer to use optimization (for example in machine learning). Optimization, in general, goes from data toward a pattern/model/equation. Including 'simulation' together with other algorithms like optimization is really a great idea. Salute to all contributors!

8Dion8 commented 4 years ago

Would a simulation of a one-dimensional cellular automata that takes a ruleset as input and outputs the image of some number of generations from one single pixel be ok? https://mathworld.wolfram.com/ElementaryCellularAutomaton.html

cclauss commented 4 years ago

@8Dion8 Please add to https://github.com/TheAlgorithms/Python/tree/master/cellular_automata

eclint commented 4 years ago

Hello_good people, Please i need help on submiting my cs50 psets. How to go about it will be appreciated .

fabrizzioalco commented 4 years ago

Which one is left to make it?

ZadeAbhishek commented 4 years ago

Any Algo left ?? to solve let me know .

onlinejudge95 commented 4 years ago

Hello_good people, Please i need help on submiting my cs50 psets. How to go about it will be appreciated .

@eclint this repo has no relation with CS:50, although you can use this as a source of algorithms, but please note that no one here is going to solve your homework