There are $24$ different pencils, $4$ different colors, and $6$ pencils of each color. They were given to $6$ children in such a way that each got $4$ pencils. What is the least number of children that you can randomly choose so that you can guarantee that you have pencils of all colors.

P.S. for 10 grade gives same problem with $40$ pencils, $10$ of each color and $10$ children.
1. **Define the problem and variables:**
   - We have 24 pencils, divided into 4 different colors: \( R_1, R_2, R_3, R_4 \).
   - Each color has 6 pencils.
   - There are 6 children, each receiving 4 pencils.

2. **Consider the worst-case distribution:**
   - We need to find the minimum number of children to guarantee having pencils of all 4 colors.
   - Let's consider the worst-case scenario where the pencils are distributed in such a way that it is difficult to get all 4 colors.

3. **Worst-case distribution example:**
   - One possible distribution is:
     \[
     (4R_1), (4R_2), (4R_3), (4R_4), (R_1, R_2, R_3, R_4), (R_1, R_2, R_3, R_4)
     \]
   - In this case, choosing 1, 2, or 3 children randomly will not guarantee pencils of all 4 colors.

4. **Another worst-case distribution:**
   - Consider another distribution:
     \[
     (4R_1), (4R_2), (4R_3), (2R_1, 2R_2), (4R_4), (2R_3, 2R_4)
     \]
   - Here, choosing 4 children randomly might still not guarantee pencils of all 4 colors.

5. **Proof for the minimum number of children:**
   - We claim that choosing 5 children will guarantee pencils of all 4 colors.
   - Suppose we choose 5 children randomly and do not get all 4 colors. This means we have at most 3 colors.
   - The maximum number of pencils for 3 colors is \( 3 \times 6 = 18 \) pencils.
   - However, 5 children have \( 5 \times 4 = 20 \) pencils.
   - This is a contradiction because 20 pencils cannot be distributed among only 3 colors if each color has at most 6 pencils.

Therefore, choosing 5 children guarantees that we have pencils of all 4 colors.

The final answer is \( \boxed{ 5 } \) children.