Simulation of an album of figures

Hi All

As might implement the following?

###########################################################################
In a class of 30 students, 17 students collect figures on an album.
The album is completed by pasting 70 figures, which are numbered 1 to
70.
Each of the collectors has a different number of figures pasted on her
album and it is almost as awards for the children meet with the
intention to change but even more detect which are the figures called
“difficult”.

Help these children, knowing the figures that each one of them has, to
determine which are the most difficult and which child has more number
of figures attached.

Use random numbers and simulation strategy to generate the figures you
have and not every child.
###########################################################################

I accept any suggestions. thanks

Hi,

It would have been nice if you’d told us your own thoughts on this taks
or at least your level of Ruby knowledge. Now all we have is a rather
vague description of your homework.

I don’t know how to measure “difficult” figures. If we assume that the
children have all the figures they could get, then “difficult” probably
just means rare.

So there are two task:

  • find the child with the most figures
  • find the rarest figure

For the implementation, I’d start by finding a good way to store the
data: You have 17 data sets consisting of a name and a set of figure
numbers (which may range from 1 to 70).

Then you have to select the most diligent child and the rarest figure.
You may want to look into the Enumerable#max_by method:

I’d use ruby.