Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Inadequate Supply Distribution Algorithm

Author
Message
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Feb 2012 15:02
This program simulates the random distribution of an inadequate supply amongst a group of entities.
Each entity has a chance, in turn, to take 1 or 0 from the supply - I call this WIN or LOSE respectively.
A WIN reduces the remaining supply for the turns that follow, a LOSE does nothing.
The probability of a WIN changes appropriately after each turn.
The probability must change in such a way that, by the end, the entire supply is consumed exactly.
With every LOSS probability increases; with every WIN probability decreases.
This is an experiment in writing such a program without the use of arrays.



Does anyone know what the proper term for this type of probability where each action influences the next?

Join DNG today! We are a game development team open to all. Visit our Headquarters to learn more.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Feb 2012 21:54
Conditional probability? In other words each probability is computed conditional on what has gone before, i.e. the past.

Is that what you mean?
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 26th Feb 2012 22:07 Edited at: 26th Feb 2012 22:12
This is what you're looking for:
http://en.wikipedia.org/wiki/Hypergeometric_distribution

The example given is choosing marbles from a bag containing white and black marbles without replacing them. In your case the colour indicates a win or loss, and you know at the start exactly how many wins and losses there will be, you just don't know how they will be distributed.

Also, there are lots of other probability distributions where the outcome of one event influences the probability of another.

[b]
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Feb 2012 03:28
Thanks, I don't understand the maths jargon but it's good to know. I really should take a maths class some time.

Join DNG today! We are a game development team open to all. Visit our Headquarters to learn more.

Login to post a reply

Server time is: 2026-07-10 17:38:15
Your offset time is: 2026-07-10 17:38:15