{"id":24716853,"url":"https://github.com/samyam81/mathematical-model","last_synced_at":"2025-08-31T16:35:24.520Z","repository":{"id":241060315,"uuid":"804201794","full_name":"samyam81/Mathematical-Model","owner":"samyam81","description":"A curated collection of mathematical models spanning various disciplines, offering insights and tools for analysis, simulation, and understanding complex phenomena.","archived":false,"fork":false,"pushed_at":"2024-05-23T04:05:47.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T09:14:25.230Z","etag":null,"topics":["bayesian-inference","bell-curve","blackscholes","gaussian-distribution","java","lotka-volterra","lotka-volterra-model","markov-chain","mathematical-modelling","mathematics"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samyam81.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-22T06:34:07.000Z","updated_at":"2024-06-23T12:07:43.000Z","dependencies_parsed_at":"2024-05-22T07:40:19.010Z","dependency_job_id":"a139f198-9428-4fc6-858b-b1e22017bf91","html_url":"https://github.com/samyam81/Mathematical-Model","commit_stats":null,"previous_names":["samyam81/mathematical-model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyam81%2FMathematical-Model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyam81%2FMathematical-Model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyam81%2FMathematical-Model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyam81%2FMathematical-Model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samyam81","download_url":"https://codeload.github.com/samyam81/Mathematical-Model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244932989,"owners_count":20534270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-inference","bell-curve","blackscholes","gaussian-distribution","java","lotka-volterra","lotka-volterra-model","markov-chain","mathematical-modelling","mathematics"],"created_at":"2025-01-27T09:14:28.165Z","updated_at":"2025-03-22T09:21:39.792Z","avatar_url":"https://github.com/samyam81.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mathematical-Model.\n\n# Population Growth Simulator\n\nThis Java program simulates population growth using the logistic growth model and the Lotka-Volterra model. It generates random parameters for the growth models and simulates the growth over a specified period of time.\n\n## Getting Started\n\nTo run the simulation, simply execute the `PredictTheGrowth.java` file in your Java environment. Ensure you have Java installed on your system.\n\n```bash\njavac PredictTheGrowth.java\njava PredictTheGrowth\n```\n\n## Overview\n\nThe program randomly generates parameters for two types of growth models:\n\n### Logistic Growth Model\n- Growth rate (r): Between 0 and 0.5\n- Carrying capacity (K): Between 0 and 2000\n- Initial population size (N0): Between 0 and 100\n- Time step (dt): Between 0 and 0.5\n- Total simulation time: Between 0 and 500\n\nIt then simulates population growth using the logistic growth equation:\n\n```\ndN/dt = r * N * (1 - N / K)\n```\n\n### Lotka-Volterra Model\n- Prey birth rate (alpha): Between 0 and 0.5\n- Predation rate coefficient (beta): Between 0 and 0.5\n- Predator-prey interaction rate (delta): Between 0 and 0.5\n- Predator death rate (gamma): Between 0 and 0.5\n\nIt then simulates population dynamics using the Lotka-Volterra equations:\n\n```\ndx/dt = alpha * x - beta * x * y\ndy/dt = delta * x * y - gamma * y\n```\n\n## Bayesian Inference Simulation\n\nThis Java program implements Bayesian inference to update beliefs about the probability of grass being wet given observations about rain and sprinkler activity. Here's how it works:\n\n- Prior probabilities (`pW`, `pR`, `pS`): These represent the initial beliefs about the probability of the grass being wet, the probability of rain, and the probability of the sprinkler being on, respectively.\n- Conditional probabilities (`pWGivenR`, `pWGivenNR`, `pWGivenS`, `pWGivenNS`): These represent the likelihood of observing wet grass given different combinations of rain and sprinkler activity.\n- Observation (`r`, `s`): These are boolean variables representing whether it rained (`r`) and whether the sprinkler was on (`s`).\n- The `calculatePosteriorProbability` function uses Bayesian inference to update the prior beliefs based on the observed data.\n- Finally, the program outputs the final posterior probability of the grass being wet given the observations.\n\n## Black-Scholes\n\nThis Java program calculates the price of a European call option using the Black-Scholes model. Here's how it works:\n\n- The `blackScholesCall` function implements the Black-Scholes formula for pricing a call option.\n- It takes parameters such as the current stock price (`s`), the strike price (`x`), the risk-free interest rate (`r`), the time to expiration (`t`), and the volatility (`v`).\n- Inside the `main` function, random values are generated for these parameters within certain ranges.\n- The `roundToFiveSignificantDigits` function rounds a given value to five significant digits.\n- Using the generated random data, the program calculates the price of a European call option using the Black-Scholes formula and outputs the result.\n\n## Output\n\nThe simulation results are printed to the console, displaying the population size at each time step for both growth models. Additionally, a plot of the results can be implemented using appropriate plotting libraries.\n\n## File Structure\n\n- `PredictTheGrowth.java`: Contains the Java code for the population growth simulation.\n- `BayesianInferenceSimulation.java`: Contains the Java code for the Bayesian inference simulation.\n- `BlackScholes.java`: Contains the Java code for the Black-Scholes option pricing.\n\n## Author\n\nThis program was created by Samyam.81[https://github.com/samyam81].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyam81%2Fmathematical-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamyam81%2Fmathematical-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyam81%2Fmathematical-model/lists"}