MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Pattern Matching

  • To: mathgroup at smc.vnet.net
  • Subject: [mg24241] Pattern Matching
  • From: Thomas Skipper <skipper at worldnet.att.net>
  • Date: Mon, 3 Jul 2000 20:39:22 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

O.K., I know this will seem useless and trivial to quite a few, but
I'm just playing around here.
Basically, what I'm doing is this:
SeedRandom["a list"]
Then:
Table[Random[Integer, {1,47}], {any  number}, {6}]
This produces a list of six numbers picked at random based on the list
in seed random. ( I think you can see where I'm going with this. My
friend Peter, a proffessor at Case Western whose specialty is
Pobabilty and Statistics says I'm all wet, but his dog Bucky, who also
is usaully pretty wet, thinks I'm on to something, but He's not
talking)
Anyway, what I want to find is n number of cases in {list a} that
match n numbers in {list b}. List a are the groups of six numbers
produced by Random.
List b are actual winning numbers. 
I tried:
Cases[{%}, {"winning numbers"}], but this will only give me cases that
match all six (I think). What I want to do is match cases in list
a(numbers produced by Random) that have 3 of six in list b(acual
winning nubers), 4 of 6 and so on. I really want to see how many sets
of six I have to produce to get any practical results, if any.
Thanks


  • Prev by Date: Detecting and handling error messages?
  • Next by Date: AW: implicit function
  • Previous by thread: Re: Detecting and handling error messages?
  • Next by thread: Re: Pattern Matching