let me reframe the questipn " From a total of n questions you have to give m
questions to each of the k students ( where m*k>n, so some question ll be
repeated eg question no 5 is given to 3 students) such that both the number
of
repeated questions and the number of repetitions of each repeated
question are minimized.
I hope m clear this time.

On Fri, Mar 25, 2011 at 12:53 AM, ligerdave <[email protected]> wrote:

> in that case, the solution doesn't apply. however, it's part of the
> solution becoz this guarantees you wont have two same questions
> generated for a student.
>
> So you have to ask the question again with clear requirements.
>
> you have to define what will be the "minimized" number. minimized to
> me is eliminated when it can go to 0.
>
>
>
> On Mar 24, 12:20 pm, snehal jain <[email protected]> wrote:
> > m*k>N . so Mx intersection My is not necessarily empty. so i think your
> > solution is not optimized.
> > please correct me if I am wrong.
> >
> >
> >
> >
> >
> >
> >
> > On Thu, Mar 24, 2011 at 7:10 PM, ligerdave <[email protected]> wrote:
> > > let's make this clear.
> >
> > > you have a total of N questions for K students, and each student gets
> > > M questions, where M1+ M2 + M3 +....+ Mn = N; Mx union My = {}empty
> >
> > > when you say the repeats should be minimized, i read it as eliminated,
> > > unless you allow a few repeated questions(in a real number, saying 2
> > > allowed)
> >
> > > to do this quickly without repeats,
> >
> > > boundary  = N.length
> >
> > > i = random() % boundary
> >
> > > pick N[i] and replace this element with current last element in the
> > > array which is N[boundary-1]
> >
> > > then boundary--
> >
> > > one iteration completed here and you can repeat those steps.
> >
> > > this way, you would never have two same questions generated and run
> > > time is O(1)
> >
> > > On Mar 24, 4:49 am, snehal jain <[email protected]> wrote:
> > > > A question set is given to you and you have to generate (question
> > > > numbers are in an array) generate different set of question paper for
> > > > k students.
> > > > in other words From a total of n questions you have to give m
> > > > questions to each of the k students such that both the number of
> > > > repeated questions and the number of repetitions of each repeated
> > > > question are minimized
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Algorithm Geeks" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected].
> > > For more options, visit this group at
> > >http://groups.google.com/group/algogeeks?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to