0
$\begingroup$

I need to write a php class fulfillment script that has to pick 4 numbers from one group (101-159) and then pick one number out of a new group that has the same number set (101-159) and over the history of the sets what is the odds that the one number picked from the second set. I know the odds of that second number that is picked not being that same is higher than it being the same, but how do I show these odds to make a better prediction of the second number.

Ok maybe a sample set of data will help me explain myself :D. These are past real results.

set1 has 101-159         set2 has101-159
rule1: 4 out of set 1 but never same
rule2: 1 out of set 2

past test results:
set1(115 123 143 145)  set2(107)
set1(108 113 117 134)  set2(135)
set1(105 133 141 154)  set2(113)
set1(104 119 128 129)  set2(105)
set1(112 124 143 144)  set2(107)
set1(106 129 134 144)  set2(128)
set1(110 130 136 138)  set2(101)
set1(105 119 129 145)  set2(125)
set1(103 121 124 138)  set2(124)
set1(121 135 146 147)  set2(102)
set1(105 123 125 128)  set2(134)
set1(116 121 127 141)  set2(114)
set1(114 116 130 151)  set2(119)
set1(110 113 115 131)  set2(118)

So I need to predict the next 3 set with it being super close. Like a one in 10 chance kinda close is the goal. Can someone steer me in the right direction?

[EDIT]

So to try to explain it a different way, as we all read things differently, I need to take a bunch of database entries and use them, and some basic formation of the entry data to predict the next one in line to occur within a error rate of something like 20%.

The rules are

There are two sets of numbers per entry
full row will be formed like (FYI: random & user choice)
====================================================
set1(115 123 143 145)                  | set2(107)
4 numbers between 101-159 non-matching | 1 number numbers between 101-159 
====================================================

Now there are some thing I think are common sense, but do know how to form in a math equation. Like, the odds of a set like this

set1(101 102 103 104)  set2(101)  <<< odd very low.

also I would think this would be a low accuring running of the chocies.

<<< odd very low.
set1(101 112 123 134)  set2(101)
set1(102 113 124 135)  set2(101)
set1(103 114 125 136)  set2(101)

And I would also think the odds of the numbers being evenly spread out is very low.. ie:

set1(101 111 121 131)  set2(141)
  • 0
    Sounds like it would be a 5/59 chance of getting a number in set 2 that is the same as one of the numbers in set 12012-02-08
  • 0
    This is a word-salad, not a question. Please ask someone who is fluent in both mathematics and English to help you edit it into something comprehensible.2012-02-09
  • 0
    @riotburn: why $5/59$ and not $4/59$?2012-02-09
  • 0
    @Gerry Myerson.. I am sorry you feel the need to say that. In short, I need to predict the closely to the next set of numbers.2012-02-09
  • 3
    I'm sorry, too, but "to predict the closely to the next set" is not the kind of thing people write if they know English and want other people to understand them. Neither is "what is the odds that the one number picked from the second set." Neither is "I need to predict the next 3 set with it being super close." Get some help with writing mathematical English, and you may get some useful answers. Otherwise, we're just all guessing what you are trying to say (and, mostly, giving up).2012-02-09
  • 0
    @Gerry Myerson.. I have accounts on the main stackoverflow sites and never had someone be this bluntly critical on the forming of the question. It fully seems that you understand the question. I would only ask that we move on to the question? I already edited it like 45 mins ago to try to bring it a little clearer but I'm a programmer not an English major :D .. Thank you for the help.2012-02-09
  • 2
    If I understood the question, I would edit it into better shape myself, and answer it if I could. I wrote what I did because I don't understand the question and, judging from the paucity of responses, others don't, either. I don't even know what a "php class fulfillment script" is, and I can't tell whether I need to know what it is in order to engage with the question. Look: if you're happy with the answers you're getting here, that's terrific. If you're not, you may want to consider taking my advice, to get some help editing your question. It can't hurt.2012-02-09
  • 0
    Well I don't know who I'd ask to help with the question.. but no the important part of the question I guess is what is in the code block area. Both set 1 and set 2 have numbers between 101 and 159. I have a list of past set 1 and set 2's. When predicting the next group, set one has 4 numbers and can't be the same. Set 2 has only one number. I need to predict as close as possible what the next group will be. The only other condition is that the odds of it being totally sequential is very small and that includes with the past number sets like a matix IO guess.2012-02-09
  • 0
    @Henry: because I can't read :)2012-02-09
  • 0
    @Gerry Myerson, I tried to explain it a different way. I hope you and the others understand. let me know if I'm clearer2012-02-10
  • 0
    @GerryMyerson: What do you know about the number in set 2 based on the numbers in set 1? If nothing, the best you can do is choose a random number in the range that is not is set 1. If you get partial credit for being close, you should guess in the middle as more numbers are close to the middle than to an end. This isn't as flip as it sounds- it is an attempt to better define the problem.2012-02-10
  • 0
    @Ross, thanks, but from a few comments up it looks like OP is trying to predict all 5 numbers, not just predict the 5th number from the first 4.2012-02-10
  • 0
    @GerryMyerson: I agree. OP: if you have information on past numbers and how set 1 correlates to set 2, that is important. If not, probably hopeless. Please share more info, if available. Else, (I think) out of luck.2012-02-10
  • 0
    Jeremy, not to answer the question but to answer your comment: mathematics thrives on clarity and accuracy in the description of problems. You are being unclear? We cannot help you to the full extent we could; you are not giving us all the information? Again, no good. This is such a foundational thing to mathematics that we cannot ignore it. **This** is why your question was picked on like that, something less likely to have happened on other websites.2012-03-11

1 Answers 1

1

Let's see if I understand the problem.

Some process is spitting out 5-tuples of numbers, $(a_1,a_2,a_3,a_4,b)$.

You know that $101\le a_1\lt a_2\lt a_3\lt a_4\le159$, and $101\le b\le159$, and for all $i$, $a_i\ne b$.

Given a list of all the 5-tuples created so far, you want to predict the next one, or maybe the next few.

You don't know what rule, if any, the process is following.

So first, let's calculate the number of different 5-tuples possible. By standard techniques, that is $(59)(58)(57)(56)(55)/24=25031930$.

This means that if the process is picking numbers randomly, then your chances of predicting the next 5-tuple exactly are 1 in 25031930.

It also puts into some perspective your feeling that the odds of, say, $(101,111,121,131,141)$ are very low: the odds of any particular 5-tuple, even of $(115, 123, 143, 145,107)$, are very low - 1 in 25031930.

Now a few things you say indicate you don't have to get it exact. You write about being "super close," "a 1 in 10 chance kinda close," "within an error rate of something like 20%." I don't really know what you mean by these. Some clarification would be welcome. Meanwhile, here's an idea that may or may not be the kind of thing you're looking for:

Look at your past test results, take the average of the numbers in the first column, round to a whole number, and make that your guess for the next $a_1$; do the same for each of the other columns to make your guess for the next $a_2$, $a_3$, $a_4$, and $b$. If your guess for $b$ turns out to be equal to one of the $a_i$ guesses, and if you are sure the process will never have the 5th number equal to one of the other four, then change your $b$-guess to the next whole number up or down.

I know you can't comment on answers, but you can edit your question to say whether I'm on the right track, or whether I'm still not understanding.

  • 0
    so with this .. (59)(58)(57)(56)(55)/24 first.. what is the 24 for and the last number would be (59) right? So you seem like you have the right idea now.. On the '"within an error rate of something like 20%." I don't really know what you mean by these' the point is that I just need to not have a 1 in a million but bring the odds down. I seems like you are getting close to what I'm driving at.. I will just need to get it a little more robust2012-02-10
  • 0
    So moving this forward I notice this is not a correct rule, $a_i\ne b$ should be $a_i\ne a_i+1$ . So when predicting the next set, is there any examples of math that show odds of something affecting the output. For example, thou yes at random I could end up with a set that is 101,102,103,104 and 105 .. ie: all in line but that is almost impossible so I'd like to lead the equation so I get better answers. Hope that is clear. Thank you for the help. -2012-02-15