>

$\mathrm{with}\left(\mathrm{RandomTools}\right)\:$

The following sets have fewer than 10 entries, because some entries were generated twice.
>

$\mathrm{Generate}\left(\mathrm{set}\left(\mathrm{posint}\left(\mathrm{range}=10\right)\,10\right)\right)$

$\left\{{1}{\,}{2}{\,}{4}{\,}{5}{\,}{6}{\,}{7}{\,}{8}{\,}{10}\right\}$
 (1) 
>

$\mathrm{Generate}\left(\mathrm{set}\left(\mathrm{rational}\left(\mathrm{denominator}=6\right)\,10\right)\right)$

$\left\{{}\frac{{2}}{{3}}{\,}{}\frac{{1}}{{2}}{\,}{}\frac{{1}}{{3}}{\,}\frac{{1}}{{2}}{\,}\frac{{1}}{{3}}{\,}\frac{{2}}{{3}}{\,}\frac{{5}}{{6}}\right\}$
 (2) 
This is corrected with the exact option.
>

$\mathrm{Generate}\left(\mathrm{set}\left(\mathrm{rational}\left(\mathrm{denominator}=6\right)\,10\,\mathrm{exact}\right)\right)$

$\left\{{0}{\,}{}\frac{{5}}{{6}}{\,}{}\frac{{2}}{{3}}{\,}{}\frac{{1}}{{2}}{\,}{}\frac{{1}}{{6}}{\,}\frac{{1}}{{2}}{\,}\frac{{1}}{{3}}{\,}\frac{{1}}{{6}}{\,}\frac{{2}}{{3}}{\,}\frac{{5}}{{6}}\right\}$
 (3) 
The following will fail, because there are only 11 values that can be generated.
>

$\mathrm{Generate}\left(\mathrm{set}\left(\mathrm{rational}\left(\mathrm{denominator}=6\right)\,100\,\mathrm{exact}\right)\right)$

The following should eventually succeed, because there are 15625 possible lists of the given flavor. However, Maple does not have specialized code to detect this case. Trying to generate almost all possible entries by random chance is likely to take a large number of iterations, so it will most probably fail in this case.
>

$\mathrm{Generate}\left(\mathrm{set}\left(\mathrm{list}\left(\mathrm{integer}\left(\mathrm{range}=1..5\right)\,6\right)\,15600\,\mathrm{exact}\right)\right)$

If we set the limiting number of iterations sufficiently high, we do get the correct result.
>

$\mathrm{result}\u2254\mathrm{Generate}\left(\mathrm{set}\left(\mathrm{list}\left(\mathrm{integer}\left(\mathrm{range}=1..5\right)\,6\right)\,15600\,\mathrm{exact}\,\mathrm{limit}=\mathrm{\infty}\right)\right)\:$

>

$\mathrm{numelems}\left(\mathrm{result}\right)$
