in reply to Re: Help Me in following code ::
in thread Help Me in following code ::

Thanks ....
But the range should now not be exclude ...
In the o/p the group of no. must be in range that is we have defined that means ::: Actually The array look like this
New Lots   Serv.
1   121
2   182
3   111
4   160
5   105
6   113
7   121
8   97

Here "New Lots" having range of (186) Respected Services are given
So now i want Such "New Lots" with group of 4/5/6 in such way that it will not be repeated it will not contain zero and respected "Serv." addition must be in between 840-900

Replies are listed 'Best First'.
Re^3: Help Me in following code ::
by BrowserUk (Patriarch) on Apr 13, 2010 at 12:41 UTC

    Sorry. But I do not understand this description at all. Maybe someone else will.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Ok let me explain again
      I have stated array above @A_services that value must be from that as well as Random number from rand function must not be zero
      as well as no repeat random no.
      Please go through with my post again and help me out
      The range of Random Number is from 1-186 the number is only from range .And respected number having value is from Array @A_services
      e.g.
      Suppose first 6 number are 1,2,3,4,5,6 now
      find its value from @A_services that is $A_servises1 that will be 121
      now add all values from array and its addition must be in between 840 - 900
      also that 6 number must not repeat any where .
      Please Give a look again

        One last try.

        • You have an array that contains 186 numbers.
        • You wish to pick groups of 6 numbers, without duplicates, from that array, that sum to between 840 & 900.
        • And once a number has been picked, it must not be picked again.

          Neither within the same group. Nor in any other group.

        Does that cover it?

        Questions:

        • How many groups of 6 do you want to pick?
        • You also mentioned "4/5/6". Does that mean you'll also accept groups of 4 otr 5 numbers?
        • Are totals of 840 & 900 both valid?

        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.