{"id":17099034,"url":"https://github.com/dinhanhx/biased-things","last_synced_at":"2025-07-22T09:08:54.207Z","repository":{"id":112393147,"uuid":"216944392","full_name":"dinhanhx/biased-things","owner":"dinhanhx","description":"Methods to generate outcomes from biased coin, dice, list","archived":false,"fork":false,"pushed_at":"2019-11-12T04:04:41.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T18:12:40.715Z","etag":null,"topics":["beginner-code","beginner-friendly","biased","coin","dice","java","list","random"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dinhanhx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-10-23T01:46:27.000Z","updated_at":"2019-11-12T04:05:43.000Z","dependencies_parsed_at":"2023-05-14T07:00:29.204Z","dependency_job_id":null,"html_url":"https://github.com/dinhanhx/biased-things","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dinhanhx/biased-things","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinhanhx%2Fbiased-things","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinhanhx%2Fbiased-things/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinhanhx%2Fbiased-things/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinhanhx%2Fbiased-things/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinhanhx","download_url":"https://codeload.github.com/dinhanhx/biased-things/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinhanhx%2Fbiased-things/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266462730,"owners_count":23932864,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["beginner-code","beginner-friendly","biased","coin","dice","java","list","random"],"created_at":"2024-10-14T15:08:50.539Z","updated_at":"2025-07-22T09:08:54.153Z","avatar_url":"https://github.com/dinhanhx.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# biased-things\nbiased coin\n\nbiased dice\n\nbiased list\n\n# Biased coin:\nMethod: public static boolean flip(double p)\n\nInstruction: you input a value which is smaller 1 and bigger than 1. The value will be the chance of true.\n\nExample: p = 0.9. The chance of getting true is 0.9 while the chance of getting false is 0.1\n\n# Biased dice:\nMethod: public static int roll(double p1, double p2, double p3, double p4, double p5, double p6)\n\nInstruction: you input 6 values which sum of them are 1.0\n\nExample: p1 = 0.1; p2 = 0.1; p3 = 0.1; p4 = 0.1; p5 = 0.1; p6 = 0.5. The chance of getting 6 is 0.5 etc.\n\n# Biased list:\nMethod: public static int pick(double[] p)\n\nInstruction: you pass an array of real values which sum of them are 1.0\n\nExample: double[] p = {0.1, 0.2, 0.3, 0.4}; The chance of getting 3rd element is 0.4 etc.\n\n## Note:\nPlease run and try out codes to understand more.\n\nAll methods use all basic programming concepts, which mean that it's easy to implement on other languages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinhanhx%2Fbiased-things","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinhanhx%2Fbiased-things","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinhanhx%2Fbiased-things/lists"}