# pls healp deal or no deal

• 09-18-2008
llinocoe
pls healp deal or no deal
can someone add my program to get 6 briefcase then compute 4 offer

base on philipppine deal or no deal that's is why the amount looks like that
Code:

```#include <stdio.h> #include <conio.h> #include <stdlib.h> long int a[26]={1,5,10,25,50,75,100,150,200,250,300,400,500 ,1000,2500,5000,10000,25000,50000,75000,100000,250000,500000,1000000 ,2000000,3000000}; long int b[26]; int player; main(){         int ctr,ctr2;         clrscr();         srand(time(NULL));         for(ctr=0;ctr<26;ctr++){               again:               b[ctr]=a[random(26)];               for(ctr2=ctr-1;ctr2>=0;ctr2--){               if(b[ctr] == b[ctr2])               goto again;               }         }         printf("Choose one of the briefcase");         printf("\nThis will be your briefcase\n");         scanf("%d",&player);         printf("You have chosen your briefcase.");         getch();         printf("\nRound 1\nOpen 6 briefcases\n");                 getch(); }```
• 09-18-2008
whiteflags
I wouldn't recommend the use of goto at all in this simple program. Especially not in your shuffling of the briefcases (at least I think that's what you're doing). Something simple like this would work:

Code:

```void shuffle () {     long int temp;     int n = 0, rnd = 0;     srand(time(NULL));     while (n < 26) {         rnd = rand() &#37; 26;         temp = briefs[n];         briefs[n] = briefs[rnd];         briefs[rnd] = temp;         n++;     } }```
On the show, the banker usually takes the mean of the amounts left, but he gets really stingy after the bigger amounts are opened. So the offer is more like a weighted average in that bigger amounts count for more. You can calculate that, right?
• 09-19-2008
master5001
If you look at the previous thread asking about how to calculate the banker's offer I think my points apply to your program as well. I would take the mean and multiply it by the probability of getting the larger valued cases available. Which is why the banker would get stingier since the coefficent will initially not make much change in the mean value.

I have no exact algorthim and I have not watched the show much but there seems to be a random element to the show.