PowerBASIC Forums
  Programming
  Looking for Reiterative Solution (Page 3)

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone!
This topic is 4 pages long:   1  2  3  4 
next newest topic | next oldest topic
Author Topic:   Looking for Reiterative Solution
David Roberts
Member
posted January 12, 2005 06:15 PM     Click Here to See the Profile for David Roberts     Edit/Delete Message   Reply w/Quote
Yeah, my wording is poor.

Instead of saying

h(1) means only one of the six selected is 'picked up' by our pool of 9.
8C5 panels ( from (9-1)C(6-1) ) = 56 such panels which have that one number.

I should have said

h(1) means the probability of only one of the six selected is 'picked up' by our pool of 9.
Given that one is 'picked up' then 8C5 panels ( from (9-1)C(6-1) ) = 56 such panels which have that one number.

blah, blah, blah

h(6) means the probability of all six selected are 'picked up' by our pool of 9.
Given that all six are 'picked up' then 3C0 panels ( from (9-6)C(6-6) ) = 1 such panel will have the six selected.

The statement <The 0.05389617 is got from h(3)+h(4)+h(5)+h(6) ie 3 or more.> is still OK because
probability is inferred by 0.05389617.

The omission of 'probability' in the previous statements was not helpful.

The maths is easy but converting into English is an art that few possess and why
top flight maths teachers are thin on the ground.

---------------------

If it helps we could define k=good and N-k=bad

The h(x) equation now reads,

h(x; N, n, k) = ( goodCx * (bad)C(n - x) )/NCn

or, in your parlance, and with Combo(Nu,n)=Total pools

h(x)=Combo(good,x)*Combo(bad,n-x)/(Total pools)

which is similar to (2) at Site 1 mentioned previously.

------------------
David Roberts

[This message has been edited by David Roberts (edited January 12, 2005).]

IP: Logged

Donald Darden
Member
posted January 12, 2005 10:13 PM     Click Here to See the Profile for Donald Darden     Edit/Delete Message   Reply w/Quote
I guess I'm just hopelessly dense. None of your efforts to express
a formulation is giving the results I'm being told I should get.
But you are obviously tiring of the effort. So let's just drop it.

I'll try to work with other sources and see if I can make sence of
what they have there. At least you've clued me to an area that I
need to explore further. So thanks for your time and effort.

------------------
Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired

IP: Logged

David Roberts
Member
posted January 13, 2005 02:39 AM     Click Here to See the Profile for David Roberts     Edit/Delete Message   Reply w/Quote
<But you are obviously tiring of the effort. So let's just drop it.>

My wording is obviously poorer than I thought. I didn't mean to convey that.
I don't tire that easy.

<None of your efforts to express a formulation is giving the results I'm
being told I should get.>

It won't be the first time that I've struggled with something and then read
another description which made sense and then when I went back to the first
description it too made sense. Looking at both Site 1 and Site 2, at first
glance they don't appear to be discussing the same thing.

Post what you have so far and express what you reckon you should be getting.

Perhaps Robert can chip in with a description that is clearer than mine?

------------------
David Roberts

IP: Logged

David Roberts
Member
posted January 13, 2005 05:32 AM     Click Here to See the Profile for David Roberts     Edit/Delete Message   Reply w/Quote
I took the car for a new cam belt this morning and walked back. It is a crisp
morning in the UK and just right for the old grey matter.

Mr Einstein was a dab hand at thought experiments so I gave it a go and came up
with the following.

Imagine a horizontal line of length N ie our 'population', say, 53.
Added: I did this walking but we can now draw the line.
The line needs to be sectioned 1, 2, 3, ..., N and each section is
magnetised. Added: Not needed - imagine it to be sectioned.

A lottery is drawn and k numbers are picked. k=6 in the examples discussed so far.

Now these k can be anywhere in our line but, to keep things simple, suppose
they are the first k sections of our line.

Draw a small vertical line k sections from the left end of our line and write
a k above them. It follows that the number of sections to the right of this
vertical line is N-k. Write N-k above them.

Now imagine a bucket filled with n magnets - n being the sample size or our pool
- and they are numbered - any n from N will do.

If we take all n and throw them at our line some, or none, will match with those
the k block and the rest will match with those in the N-k block.

Let's define 'some' as x.

Under the k block write x and under the N-k block write n-x.

Now, how many ways can this set up occur?

You are probably one step ahead of me now.

Total number = kCx * (N - k)C(n - x)

This total is for all possible pools ie NCn

So, the probability distribution for one pool is

h(x; N, n, k) = ( kCx * (N - k)C(n - x) )/NCn

QED

Phew! I need a lie down in a dark room now.


------------------
David Roberts

[This message has been edited by David Roberts (edited January 13, 2005).]

IP: Logged

David Roberts
Member
posted January 13, 2005 07:39 AM     Click Here to See the Profile for David Roberts     Edit/Delete Message   Reply w/Quote
For the record the mean of this distribution can be computed from (n * k)/N

So, with n=16, k=6 and N=53 the mean is 1.811.

That is, sometimes we get none, sometimes one, sometimes two and so on.

If we employed all possible pools then we'd average 1.811.

Added: When I was rattling on about the expected value of x in a previous
post, ie adding Ex = Ex + x * h(x) to the For/Next loop, then with the above
values we also get, thankfully , 1.811.

To complete the stats the variance can be computed from

n * k * (N - k) * (N - n)/(N² * (N - 1))

------------------
David Roberts

[This message has been edited by David Roberts (edited January 13, 2005).]

IP: Logged

Donald Darden
Member
posted January 13, 2005 06:05 PM     Click Here to See the Profile for Donald Darden     Edit/Delete Message   Reply w/Quote
I'll be back when I have it sorted out in my head. Your
explanations haven't been wide of the mark, but my problem is
in understanding the answers I get. I'm closing in on that.

Bob, going back to something you said earlier, where you did not
consider the lottery to be "fair", I disagree. It is "fair" in
that all chances, and therefore all players are theoretically on
an equal footing. Your problem is that there is no break-even
point because the state takes about 50 percent of the proceedings
and uses that for other purposes. But as you know, all organized
games are set up so that the "house" gets to keep a portion of the
procedings.

I don't think fairness is the right term for a game that does not
break-even with each play. You can focus on playing just the
games that roll over a couple of times, at which point the
outgo is likely to exceed the take on the next round. In that
case, the game's projected payout can appear to exceed the
current take.

However, this would only apply to the top winning tickets. The
lower tier winnings are fixed as to their payout, and are
deliberately undervalued so as to ensure a very large first
prize. But that bias is deliberate, and people who engage in
play in the lottery are willing to forego larger winnings on
the lower tiers if it means a chance at big bucks if they ever
get that magic 5 of 5 or 6 of 6 combination.

So regardless of how the odds are stacked, people are willing to
engage in this "voluntary taxation" if they perceive their
chances are as good as anyone elses. The problem is, that many
people are ill-equipped to realize how little chance they really
have, and what a fluke it is when someone does win. They can
easily be swayed into paying out more money on chances than they
can afford. And that is a bad thing. But protecting people
from themselves is best done through education, not from denial
of opportunity.

------------------
Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired

IP: Logged

Donald Darden
Member
posted January 13, 2005 10:45 PM     Click Here to See the Profile for Donald Darden     Edit/Delete Message   Reply w/Quote
Alright, this is what I have:

FUNCTION FmtNum(value AS EXTENDED)AS STRING
FUNCTION=LTRIM$(USING$("###,###,###,###,###",value))
END FUNCTION


FUNCTION f(n AS LONG)AS EXTENDED
LOCAL value AS EXTENDED, count AS INTEGER
value=1
FOR count=2 TO n
value=value*count
NEXT
FUNCTION=value
END FUNCTION

FUNCTION C(n AS LONG,k AS LONG)AS EXTENDED
LOCAL value AS EXTENDED, count AS LONG
value=1
FOR count=1 TO k
value=value*(n-count+1)/count
NEXT
FUNCTION=value
END FUNCTION

FUNCTION PBMAIN
LOCAL n AS LONG, k AS LONG, m AS LONG, p() AS EXTENDED, bonus AS LONG
LOCAL a AS LONG, tmp AS STRING, x AS EXTENDED, s AS LONG
COLOR 15,1
CLS
DO
PRINT
COLOR 15
LINE INPUT"What is the range (highest numbered ball) in the Lottery? ";tmp
a=VAL("0"+tmp)
IF a THEN n=a
LINE INPUT"What is the number of balls picked in each drawing? ";tmp
a=VAL("0"+tmp)
IF a THEN k=a
LINE INPUT"If there is a Bonus Ball, what is the highest number for it? ";tmp
bonus=VAL("0"+tmp)
LINE INPUT"How big is the pool of numbers you are using? ";tmp
a=VAL("0"+tmp)
IF a THEN s=a
REDIM p(0 TO s) AS EXTENDED
PRINT
COLOR 14
PRINT "The odds of winning are 1 in "FmtNum(c(n,k));
IF bonus THEN PRINT", with bonus: 1 in "FmtNum(c(n,k)*bonus);
PRINT
PRINT "A pool of"s"requires buying "FmtNum(c(s,k))" cards, ";
PRINT "with the resulting odds:"
FOR m=0 TO k
p(m)=c(n,k)/(c(s,m)*c(n-s,k-m))
PRINT "The chances of";
SELECT CASE m
CASE 0
PRINT" no matches";
CASE 1
PRINT" one ball matching";
CASE 2
PRINT" two balls matching";
CASE ELSE
PRINT m"balls matching";
END SELECT
PRINT ": 1 in "fmtNum(p(m));
IF m>0 AND bonus THEN PRINT", & match bonus: 1 in "FmtNum(p(m)*bonus);
PRINT
NEXT
LOOP
END FUNCTION

This is a sample run, if you don't want to mess with the source
code:
-----------------------------------------------------------------------------
What is the range (highest numbered ball) in the Lottery? 53
What is the number of balls picked in each drawing? 6
If there is a Bonus Ball, what is the highest number for it? 47
How big is the pool of numbers you are using? 16

The odds of winning are 1 in 22,957,480, with bonus: 1 in 1,079,001,560
A pool of 16 requires buying 8,008 cards, with the resulting odds:
The chances of no matches: 1 in 10
The chances of one ball matching: 1 in 3, & match bonus: 1 in 155
The chances of two balls matching: 1 in 3, & match bonus: 1 in 136
The chances of 3 balls matching: 1 in 5, & match bonus: 1 in 248
The chances of 4 balls matching: 1 in 19, & match bonus: 1 in 890
The chances of 5 balls matching: 1 in 142, & match bonus: 1 in 6,676
The chances of 6 balls matching: 1 in 2,867, & match bonus: 1 in 134,740
--------------------------------------------------------------------------

Now let's take zero first: As I read this, about every ten drawings I
will have a chance that I won't have any matches. So I should have
something roughly nine out of every ten drawings.

Looking at m=1, I can expect to have only one ball matched out of
the picked six roughly every once in three drawings. Roughly the
same odds for m=2. That means about 2/3rds of the drawings, I will
only have one or two balls matching.

Only that definately seems wrong. I'm only going to have one 1-pick
or one 2-pick card out of 8,008 cards bought every two of three drawings?
That sounds rediculously low. Perhaps I should be thinking of applying
the 1 of 3 to saying that a third of the 8,008 bought cards, but that
seems way to high.

Let's jump to the final line, where m=6. The election to play a pool
of 16 means buying 8,008 cards. Based on this, the 2,867 means that
you would either have to buy that many sets of 8,008 cards to get one
chance to win the current drawing, or play a set of 8,008 cards in the
next 2,867 drawings before you are likely to win the top prize. It is
no coincident that 2867 * 8008 is close to 22,957,480, as the
2867 is derived from those figures.

So while the m=6 figures seem meaningful, I have to wonder why
anyone would attempt to play pools if the expectations are really
that low across the board.

Comments welcomed.

------------------
Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired

IP: Logged

David Roberts
Member
posted January 14, 2005 12:54 AM     Click Here to See the Profile for David Roberts     Edit/Delete Message   Reply w/Quote
Firstly, your k and s seemed to have gotten transposed in p(m).

However, the results are correct - I must check the maths out sometime.

<So while the m=6 figures seem meaningful, I have to wonder why
anyone would attempt to play pools if the expectations are really
that low across the board.>

My very sentiment.

In the UK we use 49 rather than 53. Only half as many people play nowadays
compared to the early days. The only time I play now is when we have
a rollover and I only bet £2 on a couple of sixes.

The odds of winning big are very much smaller than getting struck by
lightning. I once said that if I win the lottery I'd never go out again.

------------------
David Roberts

[This message has been edited by David Roberts (edited January 14, 2005).]

IP: Logged

Donald Darden
Member
posted January 14, 2005 01:54 AM     Click Here to See the Profile for Donald Darden     Edit/Delete Message   Reply w/Quote
Yeah, well it's all about greed, isn't it? The politicians want as
much of the pot as they dare take to pay for their little projects,
which leaves you with disappointment if you play long enough, or
hard enough, and get lucky enough to win a second or third level
prize.

People don't really want a balanced game where they could win an
amount in accord to the true odds - they want a game that can
transform their whole life if they ever hit it big. They want
the dream.

Lottery commissions want rollovers to build up huge jackpots so
that they can sell a record number of tickets and don't have to
work hard to convence people to buy into such a distorted system.
They employ tools to decide how many balls to play, weighing the
probabilities of having discouraged players quitting, against the
chances of drawing even more players into the loop, trying to
find the sweet spot and more than making up the differance. They
keep coming up with new games to try and attract more players,
and the instant payouts of scratch games is appealing enough
for some to take a few more dollars out of their pockets.

Various sites and programmers promote tools that they claim will
give you a winning edge, sometimes making excessive claims that
cannot be justified by the numbers. Gail Howard's system might
have helped some people, but in what ratio to the numbers who
have tried here system? In addition, the majority probably
happened years ago when lotteries were much smaller and at far
better odds. What would count is evidence that her system is
doing well in today's gaming climate.

Stores and other outlets are offered an incentative or bonus if
they sell any big winning tickets. They cooperate by putting
the machines and results in prominent places, and having their
employees take time to sell tickets and run them to find any
matches.

Personally, the idea of winning 80- or 100-million dollars is
unreal to me. Nobody needs that much money, especially if you've
never managed huge sums before. Most of us would be happy with
an amount between $500,000 and $5,000,000 as our win-for-life
goal. Fatter small prizes would be welcomed as well. Why can't
the government be happy with a 20 to 25 percent take? Lots of
industries would find that more than adequate, especially in a
multi-million dollar market and with very little to do to earn it.

------------------
Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired

IP: Logged

David Roberts
Member
posted January 14, 2005 08:29 AM     Click Here to See the Profile for David Roberts     Edit/Delete Message   Reply w/Quote
Donald,

You've mentioned Gail Howard a couple of times so I visted her site and
looked at her UK Lottery 6/49 tips.

The first one is nonsense.

quote:
ODD-EVEN TIPS
When you select your Lotto numbers, try to have a relatively even mix of
odd and even numbers. All odd or all even numbers are rarely drawn,
occurring about one percent of the time. The best mix is to have 2/4, 4/2
or 3/3, which means two odd and four even, or four odd and two even, or
three odd and three even. One of these three patterns will occur in 80
percent of the drawings.

The reason why "All odd or all even numbers are rarely drawn" is because
they are relatively rare in the possible set of sextuplets. If they do
occur then since there are few of them for us to choose there's a good
chance of a match if we chose such a set.

In other words we have a small probability of getting to a small set. [1]

With this strategy we have a long wait for a good chance.

The reason why "One of these three patterns will occur in 80 percent of
the drawings" is because they occur in 80% of the possible set of sextuplets.
If they do occur then since there are 80% of them for us to choose from then
there's little chance of a match if we chose such a set.

In other words we have a large probability of getting to a large set. [2]

With this strategy we have a short wait for little chance.

I looked at this years ago and proved that [1] = [2]

By '=' I mean '=' - mathematically identical.

To take her logic to the bitter end.

Don't choose 1, 2, 3, 4, 5, 6 because it will rarely occur. It will rarely
occur because there's only one of them the machine can select! Our choice
is equally limited - to one.

So, we have the smallest possible probability of getting to the smallest possible set.
If it does occur then we win, if we chose it.

I looked at most of the other tips and they all shared the same flawed logic.

Added: There is, of course, a difference between [1] and [2].
There is absolutely no fun in [1]. We know we haven't got a fat chance.
With [2] our perception is positive even though we haven't got a fat chance.

------------------
David Roberts

[This message has been edited by David Roberts (edited January 14, 2005).]

IP: Logged

Donald Darden
Member
posted January 14, 2005 04:05 PM     Click Here to See the Profile for Donald Darden     Edit/Delete Message   Reply w/Quote
Hi David. I mentioned Gail Howard because she was (AFAIK) the first
to suggest that the lottery could be beat through some form or
strategy. She was mentioned again in earlier discussion after I
had made reference to her, with a quote where she claims to having
created many winners. My last comment was to point out that her
system probably served better in the 1980's when lotteries used far
fewer balls, and the odds were not as severe.

I dismissed most of her claims from the get-go. Arguing Evens and
Odds, or neighbors, or pairs, or triples, or averages, made no
sence to me. Those were just apparent associations. In my mind
it was just as likely that 2 was neighbored with 37 or 50, as it
was to 1 and 3. Thinking that certain numbers would get "hot"
and go pop! pop! pop! in close succesion seemed improbable and
unreasonable, but there did seem to be some tendency in that
regard at certain times, but never very much or very long. Again,
it is our minds trying to make sence of what we see.

So I wasn't promoting Gail Howard or her system. But I've noted
that all competitors seem to make similar claims. If one is
going to promote Evens and Odds as a gimick for playing the
lottery, they all seem to want to do the same.

I did buy her system many years ago, but only because she provided
details of all the lotteries then going on as part of it. I
could not find that information idependently - the question of
how we ever managed to do anything before the Internet is a valid
one. I wanted to know what lotteries and how they played so that
I could look at all their histories, rather than be limited to
just observing one. The USA Today was a boon because it published
results for lotteries, and you could find it anywhere. I kept
scrapbooks for several years of lottery results as I built up
programs and entered in the data by hand to work against them.
Now I just plug in a couple of URLs that publish the results and
let my program pull down past drawings. Currently I limit my
history to about 60 months of data.

I roughed out one time that of the six balls that are drawn, that
2 of them, give or take 1, would be what you might call "hot"
numbers, having occurred once or twice in say, the last twelve
drawings. Another two balls, plus or minus 1, would have been
played in say, the last 48 drawings. And 2 balls, plus or minus
1, would not have been played in recent history. Now if this
makes sence, then focusing exclusively on "hot" balls is going
to only deal with one to three of the balls likely to be drawn,
and you might have a sizeable pool just to deal with them. You
are also excluding three to five of the balls needed to make up
the winning pick. So while you might increase your odds of
getting one to three balls right, you have effectively cut down
your chances at a bigger prize. One of the sites I consulted
said pretty much the same thing, but did it from a mathematical
approach: http://www.saliu.com/bbs/messages/11.html.

This guy had done a lot to probe and document various games of
chance, including lotteries. Here are a couple of other useful
links to his various web pages, and other sites: http://www.saliu.com/bbs/messages/265.html http://www.saliu.com/bbs/messages/633.html http://www.durangobill.com/PowerballOdds.html http://www.lottostrategies.com/script/showpage/1161001/c/odds_howto.html

------------------
Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired

IP: Logged

David Roberts
Member
posted January 14, 2005 05:09 PM     Click Here to See the Profile for David Roberts     Edit/Delete Message   Reply w/Quote
Hi Donald,

I didn't think for one minute that you were promoting Gail Howard. I'd never
heard of her and went to her site out of curiosity.

There is one test that Robert mentioned and I followed up by mentioning that I'd
used it myself, namely chi-squared.

Basically, a system is assumed to be un-biased and then a chi-squared analysis
is carried out to see if there is some, strong or very strong evidence to doubt
the assumption. In other words it compares what we have with what we'd get at
random and if any deviation then if that deviation is sufficient to doubt what
we have is indeed random?

If what we have does not put a system's bias into doubt then it is pointless
using a method which uses historical data because that data is deemed to be
not sufficiently different to being 'flat'. By 'flat' I mean, in the context of
lotteries, each and every number has occurred an equal number of times.

In other words there's no point in using a history method when the system,
effectively, hasn't got one.

On the other hand, given doubt then keep very quiet about it and put
some overtime in at the 'factory'.

-----------------

I haven't got any of my old code to hand, written on an Atari ST , and needed
a sextuplet generator to test some of Howard's claims. Instead of a brute force
method which could see RND used many more times than six per set I wrote a little
Sub to emulate the lottery machine. That is, select a number from [1,49], then
from [1,48] and so on. The [1,49] is, of course, fixed and the subsets [1,48],
and so on, are 'merged' by skipping numbers in the [1,49] already chosen. With
this method RND is only used six times.

If you'd like a copy to play around with, let me know and I'll post it here.

I'll have a look at your links later.

------------------
David Roberts

[This message has been edited by David Roberts (edited January 14, 2005).]

IP: Logged

Donald Darden
Member
posted January 14, 2005 08:01 PM     Click Here to See the Profile for Donald Darden     Edit/Delete Message   Reply w/Quote
Thanks, I would appreciate that. I had a bit of college math,
and a short course in statistics several decades ago. My strong
suit was the computer and systems training I got in the Navy, and
I worked up from machine language to various programming languages.
As a Systems Engineer, I had myrad hardware and software
responsibilities, and as a Systems Analyst, I had more to do with
collecting performance data and devising methods of finding the
rule, then applying the rules to spotting the troublesome exceptions.
I got real good at manipulating data that was intended to be read by
human eyes and reducing it to a form that machines could handle.

So It's not like I didn't earn my titles or deserve my pay. But It
just takes me longer to get a handle on the math involved. I don't
read advanced math notation very well, since little of it surfaced
in my courses. If mathematics is the universal language, then for
the most part I have been rendered deaf and dumb.

But I can write code. And if I can understand the notation, I
can correlate it to coding processes. I guess I'm part of a
small group that feels that coding is a better (and more
practical) way of speaking the universal language.

So yes, I would be pleased to see what else you have to say on
the subject.

As to a random process for picking a series of lottery numbers,
this technique works well:

Assume a drawing of 53 balls, of which six will be needed:


DIM balls(1 TO 53) AS BYTE
FOR a=1 TO 53
balls(a)=a 'set up the balls first
NEXT
next_game:
RANDOMIZE 'randomize the random seed using timer
FOR a=1 to 53 'ensure every ball is targeted
b=RND(1,53) 'point to any other ball position
SWAP balls(a),balls(b) 'swap every ball at least once
NEXT
DIM picks(1 TO 6) AS BYTE 'these will be our current picks
for a=1 to 6 'there will be six balls
b=RND(a,53) 'the random pick comes from unpicked balls
SWAP balls(a),balls(b) 'this is now at least two sorts on balls
picks(a)=balls(a) 'we move the selected ball into Picks()
next

It's essentially the same method I use for suffling and dealing
cards, but in this case I worked from the bottom instead of the
top. Note you do not have to set up the balls again before you
start the next drawing - The selected balls are still in the
balls array, and will be resorted and picked from, right along
with the rest. You just begin at the label called next_game.
This method causes more sorts on top of prior sorts, making the
outcome more difficult to predict - unless you can account for
all the changes each sort produces.

I've heard that story before, about a lottery being based on a
pseuod-random process, and I've also heard that some genius of
a programmer has broken the random process used to pick the
cards dealt in one of the online poker games. I don't believe
either one.

First, while lottery officials are possibly stupid enough to trust
the randomness of PRNG in a computer, no competent programmer
should be that ignorant.

Second, the amount of times that the drawing has to occur in
order to build history before it starts over has got to be a real
long time, and what lottery has that much history?

Third, the order of the balls as they come up in the drawing is
rarely reported - instead, we see the picks displayed in a
numerical sequence. That would be disruptive to efforts to
recognize the sequence of those numbers in the random sequence.

Fourth, we would have to assume that the random sequencer was
never interrupted, never reseeded, and never used for anything
else. Now how probable is it that one computer sits there with
power on, doing nothing but sitting there waiting for the next
lotto drawing? It could not even be used for any type of game
or additional drawings, unless each instance of an PRNG was
fully independent of all other instances. Even the lottery
program could not be terminated and restarted for this condition
to hold true.

The online poker game concept is even harder to defend. You can
have multiple servers and multiple programs running concurrently,
and during play you only see a portion of the cards that are
dealt, and never enough or close enough in sequence to be sure of
just how the play is going to go. Every game should follow a
reshuffle of the card deck, and the deal will vary according to
the number of players at the table. For some games (not Hold'em),
if a player folds, it will change the outcome of the rest of the
game. Most players will not disclose their hold cards if they
lose, so you have nothing there to add to your observations. And
not all random number sequences are alike - some programmers
chose to implement their own, or apply them in different ways.

You cannot be sure if the same program is serving several tables
at the same time, or if there are multiple instances of the
program running. The a single program is serving several tables
at once, using different decks, the random process will be split
between the shuffles and deals done for those tables, so the
information from one table would be incomplete. The only thing
you can possible try to cue a forward reference from is the game
number, but I see no evidence that the game number is directly
associated with the random process for the hand that follows.

If you want a challenge, try to figure out if observing a lottery
or poker game would (1) provide enough information to determine
if a PRNG is involved; (2) establish how long (how many games)
it would take to reach this conclusion, and (3)whether the
results could be used to project the winning picks or strategy
for the game.

Right now, it think people that have just a little bit of
knowledge have gotten a bit fanciful in what they think you can
do with that knowledge, and have added to urban legends in their
efforts to persuade others by claiming that it really happened.

------------------
Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired

IP: Logged

David Roberts
Member
posted January 16, 2005 04:23 AM     Click Here to See the Profile for David Roberts     Edit/Delete Message   Reply w/Quote
By the time BYTE is changed to LONG and the first FOR/NEXT is removed your
code is almost the same as mine.

I've put mine into a Sub but do not not employ RANDOMIZE within it. I
execute RANDOMIZE in PBMAIN and forget about it.

I only used it to generate large sets of sextuplets but since the code churns
out about 10,000 sets a second on my 600MHz machine then a request for, say,
2000 sets could see TIMER unchanged as it is only updated once per second.

You probably know this trick but in case not if a Sub is used then we can use


SUB GetSel( Picks() AS LONG)
DIM balls(1 TO 53) AS STATIC LONG
STATIC SecondEntry AS LONG
LOCAL a AS LONG, b AS LONG

IF SecondEntry = 0 THEN
FOR a = 1 TO 53
balls( a ) = a
NEXT
SecondEntry = 1
END IF

blah, blah, blah

where balls() is set up only on GetSel's initial call.

<So It's not like I didn't earn my titles or deserve my pay. But It
just takes me longer to get a handle on the math involved.>

The older I get the longer it takes me to get a handle on anything!

<I guess I'm part of a small group that feels that coding is a better
(and more practical) way of speaking the universal language.>

When I read mathematics I didn't read it alongside a main subject,
it was my main subject but it eventually splits into either
a 'Pure' stream or an 'Applied' stream. I went the 'Applied' route
but that split into a 'Statistical' stream or a 'Numerical' stream.
I went with the 'Numerical' stream. As a Numerical Analyst I was a
very different animal to my friends who were 'Pure' mathematicians.
The 'Pure' mathematicians were almost invariably destined for academic
life with the rest of us being able to speak mathematics and English.

<Third, the order of the balls as they come up in the drawing is
rarely reported - instead, we see the picks displayed in a
numerical sequence. That would be disruptive to efforts to
recognize the sequence of those numbers in the random sequence.>

I don't figure this to be important especially since a particular
number, if picked, will only be picked once a drawing.

It's worth remembering that with multiple machines and multiple sets
of balls the chosen equipment is not known a priori so any trends
are analogous to trends of mankind rather than trends of
ethnic groups.

<Right now, it think people that have just a little bit of
knowledge have gotten a bit fanciful in what they think you can
do with that knowledge, and have added to urban legends in their
efforts to persuade others by claiming that it really happened.>

We could take that out of context and apply it generally.

------------------
David Roberts

IP: Logged

Donald Darden
Member
posted January 16, 2005 03:50 PM     Click Here to See the Profile for Donald Darden     Edit/Delete Message   Reply w/Quote
David, I think you might be interested in the posts from Ion in
this thread: http://www.powerbasic.com/support/forums/Forum6/HTML/004714.html.
He seems to be on a different track than you are, and you might
enjoy. or at least be interested, in the discussion underway.

------------------
Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired

IP: Logged


This topic is 4 pages long:   1  2  3  4 

All times are EasternTime (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | PowerBASIC BASIC Compilers

Copyright © 1999-2005 PowerBASIC, Inc. All Rights Reserved.


Ultimate Bulletin Board 5.45c