Hi there,(adsbygoogle = window.adsbygoogle || []).push({});

I am getting an iphone/android app developed and there is a new part that needs to be programmed.

A store can create a free offer and assign the random probability odds of winning that prize.

If they create 3 offers for their restaurant with the following win odds.(they can have as many prizes as they want so the equation/code must be dynamic so based on the number of prizes the formula should always give out the correct prizes0

Prize 1 = Free starter with win odds 10:1

Prize 2 = Free main course with win odds 50:1

Prize 3 = Free main course with win odds 200:1

When the app user goes into the store they scan a barcode. This is where I am stuck, I want the user to have a chance to win any of the prizes and for the correct amount of people to have won a prize as I don't want the equation/code to be wrong and the store has to give out much more free stuff than what they had bargained for,I also don't want too few winners as people will stop using it if they are not winning.

Can anyone suggest the best way to code for this(I have no programming experience but have a team in India programming it but want to give them proper instructions). I was thinking the only way that it could be done is when you scan the barcode the program code will randomly select one of the prizes available and then apply the random odds of that prize to see if you won.

Is there a better way to approach this?

Is there a way to combine the odds?

Can anybody suggest how I can get this section to work right. If you need more info please post and I can answer.

Thanks in advance,

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Probability program equation in app.

Loading...

Similar Threads for Probability program equation |
---|

Insights Intro to Algorithms for Programming - Comments |

C/++/# Ideas for a physics or math programming project? |

Program that calculates the list of x and f(x) for a given function |

C/++/# How to use C++ in studying calculus |

I need help decrypting this |

**Physics Forums | Science Articles, Homework Help, Discussion**