Re: [algogeeks] Re: generate ques set

2011-03-26 Thread Kamakshii Aggarwal
@ligerdave:whai if m*k>n. in this case some questions have to be repeated. On Thu, Mar 24, 2011 at 7:10 PM, ligerdave 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 >

[algogeeks] Re: generate ques set

2011-03-25 Thread bittu
i think its like the generating the the number with equal probability in given range thats it.if i understood the question correctly so a shuffle algorithm will do that in o(n) like Knuth Shuffle will do it so its like shuffling deck of card with equal probability public static void shuffle(int[

Re: [algogeeks] Re: generate ques set

2011-03-25 Thread snehal jain
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 que

[algogeeks] Re: generate ques set

2011-03-24 Thread ligerdave
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 el

Re: [algogeeks] Re: generate ques set

2011-03-24 Thread snehal jain
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 wrote: > let's make this clear. > > you have a total of N questions for K students, and each student gets > M questions,

[algogeeks] Re: generate ques set

2011-03-24 Thread ligerdave
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, sayin