[TI-BASIC] Non-Repeating Random Numbers

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

CompWiz
Calc King
Posts: 1950
Joined: Thu 13 Oct, 2005 1:54 pm
Location: UB

Post by CompWiz »

benryves wrote:PNG is a pretty wasteful format in any case, GIF would be more appropriate.

I suggest saving as a Windows .bmp file then converting using XnView (freeware) to GIF. tinypic should be good for hosting.
how is png wasteful? Is there a better lossless format that works in most browsers?

You know, an easier way to convert it without downloading anything is to just upload a bmp to imageshack, and it will automatically convert it to png.
In Memory of the Maxcoderz Trophy Image
Floodkiller
Sir Posts-A-Lot
Posts: 245
Joined: Mon 14 Nov, 2005 9:47 pm
Location: Getting overwhelmed by everything
Contact:

Post by Floodkiller »

well, using the Deal or No Deal flash game created by nbc (although it isn't as realistic as the show), I can give you this situation...

There are 6 amounts left in play: 100, 300, 400, 750, 1000, and 300000. Your briefcase contains one of these amounts. This next round, you must open one briefcase. The banker's offer is 19,110.

If you can wait for tomorrow after the show tonight at 7, I can give you a scenario from the game, if that can be more accurate.
Main Projects:
Zombie Attack: 20%

Side Projects:
???-25%

Image

Staff member of Hikaru Rakuen Programming.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

so the bankers offer should be something between the highest and second higest and some chance and something else? right?
Floodkiller
Sir Posts-A-Lot
Posts: 245
Joined: Mon 14 Nov, 2005 9:47 pm
Location: Getting overwhelmed by everything
Contact:

Post by Floodkiller »

umm, I think so...

Edit: ok, I've got some show data from last night:
Just so you know, the amounts are: 0.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750, 1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 750000, 1000000.

First round (6 cases eliminated):
20 cases left
Cases Eliminated: 0.01, 5, 10, 25, 5000, 300000
Banker Offer: 18,000

Second Round (5 cases eliminated):
15 cases left
Cases Eliminated: 100, 500, 10000, 200000, 750000
Banker Offer: 26,000

Third Round (4 cases eliminated):
11 cases left
Cases Eliminated: 50, 200, 750, 100000
Banker Offer: 62,000

Fourth Round (3 cases Eliminated):
8 cases left
Cases Eliminated: 75, 300, 400
Banker Offer: 129,000

Fifth Round (2 cases Eliminated):
6 cases left
Cases Eliminated: 1, 500000
Banker Offer: 155,000 + Tractor (lol) (value of 33,620)= 188,620

Sixth Round (1 case eliminated):
5 cases left
Cases Eliminated: 75000
Banker Offer: 257,000

The game's still going on tonight :D.
Main Projects:
Zombie Attack: 20%

Side Projects:
???-25%

Image

Staff member of Hikaru Rakuen Programming.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

I havent been able to come up with anything yet, sorry.
But since there arent many possibility's, couldn't you just hard-code it in?
Floodkiller
Sir Posts-A-Lot
Posts: 245
Joined: Mon 14 Nov, 2005 9:47 pm
Location: Getting overwhelmed by everything
Contact:

Post by Floodkiller »

Actually, I can't. Before I even started the game, I calculated the probabilities for the offers every time...

Number of different types of ways to do the first round and get an offer:
2.154334728e22

Which in other words means:
Just hard-coding the banker's offer would take over the ram limit, not including the program to include it with.
Main Projects:
Zombie Attack: 20%

Side Projects:
???-25%

Image

Staff member of Hikaru Rakuen Programming.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

uhm, hard code a few sets of posibilitys and add/substract/multiply the luck?
The whole thing is still a bit too vague for me to make a good formula for. You, however, know exactly what you're looking for, so if I were you I would write every rule for the size of the offer down and then put them together (or give them to me so I can put them together)
Last edited by King Harold on Wed 18 Oct, 2006 2:29 pm, edited 1 time in total.
Floodkiller
Sir Posts-A-Lot
Posts: 245
Joined: Mon 14 Nov, 2005 9:47 pm
Location: Getting overwhelmed by everything
Contact:

Post by Floodkiller »

ok, it will take me a while to figure out the right way that it should shape.
Main Projects:
Zombie Attack: 20%

Side Projects:
???-25%

Image

Staff member of Hikaru Rakuen Programming.
Floodkiller
Sir Posts-A-Lot
Posts: 245
Joined: Mon 14 Nov, 2005 9:47 pm
Location: Getting overwhelmed by everything
Contact:

Post by Floodkiller »

Ok, I've got two theories for making it, but I just need help in developing the probability part of each. (ADD2 is the list of values for the cases, OPTN is the list of remaining breifcases, used for gameplay display purposes). The probability part consists of the amount of high numbers in play remaining, cases to eliminate, and total number of cases.

1)

Code: Select all

sum(LADD2)/(sum(LOPTN)+1)
*insert probability part here*
2)

Code: Select all

*find highest and lowest numbers remaining using for loops on ADD2)*
*insert probability part here*
I tried my own probability formula, but it only works for the first round. It is ((amount of high numbers in play remaining)/(cases to eliminate next round(X-1))*(total number of cases))*(one of the two ways I listed above).

Any suggestions to modify it?
Main Projects:
Zombie Attack: 20%

Side Projects:
???-25%

Image

Staff member of Hikaru Rakuen Programming.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

I was just thinking, could the main formula just be an ax+b, with luck and something with the cases added?
Floodkiller
Sir Posts-A-Lot
Posts: 245
Joined: Mon 14 Nov, 2005 9:47 pm
Location: Getting overwhelmed by everything
Contact:

Post by Floodkiller »

I am having just a little bit of trouble understanding what the a, x, and b are valued as. Could you clarify just a bit?
Main Projects:
Zombie Attack: 20%

Side Projects:
???-25%

Image

Staff member of Hikaru Rakuen Programming.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Sorry, I didn't try it out yet, and it probebly isn't really liniar anyway, it was just an idea..
x would be the number of the round (x-th round)
I don't know what a and b would be but you can find out by doing a liniar-regression on the values mentioned a few posts earlier.
jbshaler
Maxcoderz Staff
Posts: 22
Joined: Fri 17 Dec, 2004 8:35 pm
Location: Michigan

Post by jbshaler »

From http://nslog.com/2005/12/20/deal_or_no_deal_algorithm/, there is one comment that should be useful, although it is not authoritative:
The banker's algorithm takes the average winning value at any given point in the game (which is the sum of the unexposed cases), multiplied by a sliding scale factor. That sliding factor severely pushes below the average winning position at any given state early in the game, then approaches the true average when the contestant is down to four or fewer cases.

In some rough comparisons against a quick PC model I built, it appears that the bankers algorithm is computed as a percentage of the average winning value in this approximate sequence:

11%, 15%, 22%, 37%, 70%, 90%, 100%

If you plot those numbers on an Excel graph, you'll find they make a rather clear tilted S shape, so even if the numbers aren't precise, I'm confident they're close enough to demonstrate that it is a predetermined formula. The extensive profile contestants fill out probably contributes to a tweaked version of that graph that includes an estimate of a given contestant's risk aversion.
Maybe that'll help if you're still having trouble with this.
Floodkiller
Sir Posts-A-Lot
Posts: 245
Joined: Mon 14 Nov, 2005 9:47 pm
Location: Getting overwhelmed by everything
Contact:

Post by Floodkiller »

That helps alot about describing it :D.

Hmm, so if I understand it right, I take the sum of remaining amounts, divide it by a number that changes according to how far the game is going along, then multiply by the percentage chance of winning the highest number in play compared to others left in play.

Although I am not sure if that is correct :?
Main Projects:
Zombie Attack: 20%

Side Projects:
???-25%

Image

Staff member of Hikaru Rakuen Programming.
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

wow... it's jbshaler. What's been up man? :)
Image
Post Reply