Random numbers Depending on likely probability.
I have been wanting to start a new project for a while but have been putting it off now because of a few thing's.
1) It is something i have never tried before.
2) Right now the probability side of the application would be beyond me.
How ever i say to myself. I have no time limit it needs to be completed in. I would be expanding my knowledge along the way, and it seems like an interesting project to be working on.
The idea it self is similar to drug wars(it's only a game so no comments ;) )
Depending on a new day, different location the price will vary. How ever there is obviously a set likely hood range the price will fall in, but obviously can go above/below this. Also need to take into consideration random events. Police raids, Being attacked, loosing inventory etc.
Does any one have any advice or links regarding random events, taking into account probability. Or any thing else that might be useful.
Re: Random numbers Depending on likely probability.
Try searching this forum for "weighted random". I think it will throw up several examples that may help you. The class in post no #11 by Jenner in this thread looks interesting to me. BB
Re: Random numbers Depending on likely probability.
You could use a random number generator to see what happens on what days. I thought about making a similar game to what you're trying to do (I have played Drug Wars, made a cheap windows console clone that hardly worked, but that was years ago).
Anyway, look into the Random Class.
Re: Random numbers Depending on likely probability.
Your description sounds like you want the range to be normally distributed. However, you might consider that the price one day would be similar to the price on the day before. They might be related, even, so day to day may not be truly random.
One thing you might consider is the function mX(1-X), which behaves chaotically for some values of m. Try a value around 3.97 to get a chaotic pattern (you could look at it in Excel). The value would be fluctuating in a narrow range, so you would have to multiply that by something to get a more useful range, but each day would then be related to the previous day, though not in a way you could figure out.
Re: Random numbers Depending on likely probability.
Thanks every one for the reply's.
I think the weighted number class would be very useful for raids, loss of items etc... but i dont think it would be so good for the drug values. Since the drugs will idle around specific ranges for example £150/£230(average) now and then going between £100-£150 or £230-£300 (good prices and bad prices) or £50-100 £300 £300+ (very very good price vs very very bad price obviously the higher or lower it gets will be less and less weighted.
I don't mean to go all inception here but would it come down to a weighted random in a weighted random???? (could go crazy here thinking it them all lol)
Shaggy Hiker:
You just completely lost me :D
Re: Random numbers Depending on likely probability.
Quote:
Originally Posted by
ident
Thanks every one for the reply's.
I think the weighted number class would be very useful for raids, loss of items etc... but i dont think it would be so good for the drug values. Since the drugs will idle around specific ranges for example £150/£230(average) now and then going between £100-£150 or £230-£300 (good prices and bad prices) or £50-100 £300 £300+ (very very good price vs very very bad price obviously the higher or lower it gets will be less and less weighted.
I don't mean to go all inception here but would it come down to a weighted random in a weighted random???? (could go crazy here thinking it them all lol)
Shaggy Hiker:
You just completely lost me :D
I felt totally lost too because I thought Shaggy's formula would just be a parabola But I think I found an explanation here: http://en.wikipedia.org/wiki/Logistic_map. Now I am only significantly lost:ehh:. BB
Re: Random numbers Depending on likely probability.
Quote:
Originally Posted by
boops boops
I felt totally lost too because I thought Shaggy's formula would just be a parabola But I think I found an explanation here:
http://en.wikipedia.org/wiki/Logistic_map. Now I am only significantly lost:ehh:. BB
I think i will have to book mark that one for tomorrow lol looks quite mind tiring
Re: Random numbers Depending on likely probability.
Wow, that's quite the page. Normally, Wiki entries are quite informative. In the case of that one, it couldn't have been drier if they had packed it in metalic sodium.
Still, I saw that my memory hadn't served, as the value for m that I actually wanted was around 3.59 rather than 3.97 (I was thinking that it had to be above 3.95, so I chose a value slightly above that to be safe, but I had the numbers backwards).
I didn't know the history of the function, I just knew that it exhibited chaotic behavior at some point. I first used it in an aquatic population model with eight species. Since the lowest level of the food chain would be plankton (not counted in the 8 species), and since a paper showed that any population of plankton with more than 3 species would be certain to be in chaotic equilibrium, I used that equation with three variations of m to serve as the food source for the lowest level of the food chain...which created a population equation that was too unstable to be solved by a human mind...so I wrote a GA to evolve a stable equation...and things kind of snowballed from there.
The point was that you could use a normally distributed set of numbers such that day X had no relationship to day X+1 other than that they statistically clumped together, or you could make the value of day X+1 related to the value of day X, but related in a fashion that seemed kind of predictable....but wasn't.