# no need for translation
!set n=$teller
!if $graad =0
    R=$teller
!else
    R=$graad
!endif        
nivo_title=!record 9 of lang/remarks.$taal
multiplechoice=0                
a=!randint 1,20
a=$[$a*1000]
b=!randint 5,25
B=$[$b/100]
ondergrens=$[floor($B*$a/100)]
factor=!randitem 2,2
bovengrens=$[$ondergrens + $factor]
c=$[1-$B]
d=!randint $ondergrens,$bovengrens
d=$[$d*100]
bosbouwer=!record 46 of lang/remarks.$taal
bosbouwer=!randitem $bosbouwer
# Staatsbosbeheer,Een bosbouwer,De Heidemij,Het Gelders Landschap,Het Overijsels Landschap
bomen=!record 47 of lang/remarks.$taal
bomen=!randitem $bomen
# zeelandia populieren,paardekastanjes,esdoorns,acacias,zwarte populieren,douglas dennen
ss=!record 48 of lang/remarks.$taal
# $bosbouwer exploiteert een perceel waar $a $bomen staan.<br>\
# Elk jaar wordt er $b % van deze bomen gekapt en er $d bij geplant.<br>\
# Het aantal $bomen op het totale perceel vormt een rij <b>B<sub>n</sub></b>.<p>
opgave$n=$ss
antwoord$n=$empty

!if $R=1
    aantal_vragen=2
    bewerking=nivo/bewerking1.proc
    ss=!record 49 of lang/remarks.$taal
    # B<sub>1</sub>=$a <br>Bereken <b>B<sub>2</sub></b> en <b>B<sub>3</sub></b>
    somtekst$n=$ss
    B2=$[$c*$a+$d]
    B3=$[$c*$B2+$d]
    GOED$n=$B2,$B3
    goed$n=B_2=$c \cdot $a + $d \and B_3=$c^{2} \cdot $a + $c \cdot $d + $d
 !exit
!endif

!if $R=2
    bewerking=nivo/bewerking6.proc
    # letop round/floor in goede antwoord
    t=!randitem 4,5,6,7
    ss=!record 50 of lang/remarks.$taal
    # Gegeven B<sub>1</sub> = $a <br>Bereken <b>B<sub>$t</sub></b>
    somtekst$n=$ss
    G=$[($c^($t-1))*$a+($d*(1-$c^($t-1))/(1-$c))]
    G1=$[round($G)]
    G2=$[floor($G)]
    !if $G1!=$G2
	GOED$n=$G1,$G2
	GG=$G1 \cdot \cdot \cdot $G2
	aantal_vragen=2
    !else
	GOED$n=$G1
	GG=$G1
	aantal_vragen=1
    !endif	

    tot=$c^{$[$t-1]} \cdot $a
    !for p=2 to $t
	tot=!append line +$c^{$[$t-$p]}\cdot $d to $tot
    !next p
    goed$n=$tot = $c^{$t}\cdot $a + $d \cdot \frac{1-$c^{$t}}{1-$c} = $GG
 !exit
!endif

!if $R=3
    bewerking=nivo/bewerking6.proc
    # letop round/floor in goede antwoord
    t=!randint 10,35
    ss=!record 51 of lang/remarks.$taal
    somtekst$n=$ss
    # Gegeven B<sub>1</sub> = $a <br>Bereken <b>B<sub>$t</sub></b>
    G=$[($c^$t)*$a+($d*(1-$c^$t)/(1-$c))]
    G1=$[round($G)]
    G2=$[floor($G)]
    !if $G1!=$G2
	GOED$n=$G1,$G2
	GG=$G1 \cdot \cdot \cdot $G2
	aantal_vragen=2
    !else
	GOED$n=$G1
	GG=$G1
	aantal_vragen=1
    !endif	
    goed$n=$c^{$[$t-1]} \cdot $a + $d \cdot \frac{1-$c^{$[$t-1]}}{1-$c} = $GG
    
 !exit
!endif 

!if $R>3
    bewerking=nivo/bewerking6.proc
    # letop round/floor in goede antwoord
    aantal_vragen=2
    t=!randint 10,35
    ss=!record 52 of lang/remarks.$taal
    somtekst$n=$ss
    # Het aantal $bomen op het perceel wordt na verloop van tijd stabiel.<br>\
    # Hoeveel $bomen staan er dan op het perceel in deze <b>stabiele</b> situatie ? 
    G1=$[floor($d/(1-$c))]
    G2=$[round($d/(1-$c))]
    !if $G1!=$G2
	GOED$n=$G1,$G2
	GG=$G1 .... $G2
	aantal_vragen=2
    !else
	GOED$n=$G1
	GG=$G1
	aantal_vragen=1
    !endif	
    ss=!record 53 of lang/remarks.$taal
    antwoord$n=$ss
    # Het "dekpunt" vind je met de recursie formule:<p align="center">\
    # B<sub>n</sub>=$c &times; B<sub>n-1</sub> + $d </p>\
    # We lossen op <em>x=$c*x+$d</em> ; dus het "dekpunt" <em>x</em>=$d/(1-$c) <br>\
    # Het aantal gekapte $bomen is dan: $d/(1-$c) = $GG
    goed$n=$empty
 !exit
!endif 
