# permutaties & combinaties II
!set n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif  
formula$n=$empty
var1=0
math=0
mathview=0
cols=15
rows=5
helptext=$empty
# dus aantallen en geen kans 0<P<1
image=0
questiontype=0
formula$n=$empty
checkfile=exos/checkfile1.proc
exotext=$empty

gender=!randitem 1,2
!if $gender=1
    namen=!record 78 of $remarkdir/commonremarks.$taal
    #:Hij,hij,hem,zijn
    rec=107
!else
    namen=!record 79 of $remarkdir/commonremarks.$taal
    rec=108
    #:Zij,zij,haar,haar
!endif

namen=!shuffle $namen
naam=!item 1 of $namen
voor=!record $rec of lang/remarks.$taal
Hij=!item 1 of $voor
hij=!item 2 of $voor
hem=!item 3 of $voor
zijn=!item 4 of $voor
telwoorden=!record 59 of $remarkdir/commonremarks.$taal
super=!record 115 of lang/remarks.$taal
#@Lidl,AH,Aldi,Super de Boer ,EDAH,COOP,Karstadt,V&D,HEMA
super=!randitem $super
!if $R=1
    a=!randint 15,30
    b=!randint 4,8
    A=!item $a of $telwoorden
    B=!item $b of $telwoorden
    question$n=!record 116 of lang/remarks.$taal
    #@$naam heeft een prijsvraag gewonnen bij de <em>$super</em>.<br>\Uit $A producten mag $hij er $B gratis uitzoeken.<br>$Hij mag ook $B dezelfde producten kiezen...<br><br>Hoeveel keuze mogelijkheden heeft $naam ?
    
    answer$n=$[$a^($b)]
    tot=$empty
    !for p=1 to $b
	tot=!append word @$a to $tot
    !next p
    tot=!nospace $tot
    tot=!char 2 to -1 of $tot
    tot=!replace internal @ by \times in $tot
    
    textanswer$n=
    texanswer$n=$tot \,=\, $a^{$b} \,=\, $(answer$n)
 !exit
!endif

!if $R>1
    a=!randint 15,30
    b=!randint 2,8
    A=!item $a of $telwoorden
    B=!item $b of $telwoorden

    question$n=!record 117 of lang/remarks.$taal
    #@$naam heeft een prijsvraag gewonnen bij de <em>$super</em>.<br>Uit $A producten mag $hij er $B gratis uitzoeken.<br>$Hij mag elk product maar &eacute;&eacute;n keer kiezen...<br><br>Hoeveel keuze mogelijkheden heeft $naam ?
    
    answer$n=!exec pari (factorial($a))/((factorial($[$a-$b]))*(factorial($b)))
    textanswer$n=!record 114 of lang/remarks.$taal
    #@Met de grafische rekenmachine:<br> $a ncr $b<br>zie ook deze <a href="$module_dir/docs/combinaties_en_permutaties.pdf">uitleg</a> (PDF)
    texanswer$n=\left( \begin{array}{c} $a \\ $b \end{array} \right) = \frac{ $a !}{$b ! \cdot $[$a - $b] ! } = $(answer$n)
 !exit
!endif












