#bewerking=$commondir/number.proc
#varlist=x
bewerking=nivo/bewerking6.proc
PLAATJE=0
!set n=$teller
!if $graad =0
    R=$teller
!else
    R=$graad
!endif        

nivo_title=!record 3 of lang/remarks.$taal
somtekst$n=!record 62 of lang/remarks.$taal

!if $R=1
    keuze=!randitem 1,0
    pm=!randitem 1,-1
    # g^(ax+b) = 1 => ax+b =0 => x=-1*(b)/(a)
    a=!randint 2,20
    a=$[$pm*$a]
    b=!randitem 1,2,3,4,5,6,7,8,9,10
    g=!randitem 2,3,4,5,6,7,8,9,10,e
    !if $keuze=0
	opgave$n=$g^($a*x + $b) = 1
	GOED$n=!exec pari (-1*$b)/($a)
	goed$n= -> $g^($a*x + $b) = $g^0 -> $a*x + $b = 0 -> x = $(GOED$n)
    !else
	opgave$n=$g^($a \cdot x - $b) = 1
	GOED$n=!exec pari ($b)/($a)
	goed$n= -> $g^($a*x - $b) = $g^0 -> $a*x - $b = 0 -> x = $(GOED$n)
    !endif
 !exit
!endif 

!if $R=2
    # g^((x+b)(x+a)) = 1 => (x+b)(x+a)=0 => x=-a,-b    
    cijfers=!shuffle 1,2,3,4,5,6,7,8,9,10
    a=!item 1 of $cijfers
    b=!item 2 of $cijfers
    g=!randitem 2,3,4,5,6,7,8,9,10,e
    keuze=!randitem 0,1,2
    !if $keuze=0
	opgave$n=$g^((x+$a)(x+$b)) = 1
	GOED$n=$[-1*$a],$[-1*$b]
	goed$n=$g^((x+$a)(x+$b)) = $g^0 -> (x+$a)(x+$b)= 0 -> x_1=$[-1*$a]  x_2=$[-1*$b]
    !else
	!if $keuze=1
	    opgave$n=$g^((x-$a)(x-$b)) = 1
	    GOED$n=$a,$b
	    goed$n= -> $g^((x-$a)(x-$b)) = $g^0 -> (x-$a)(x-$b)= 0 -> x_1=$a V x_2=$b
	!else
	    opgave$n=$g^((x+$a)(x-$b)) = 1
	    GOED$n=$[-1*$a],$b
	    goed$n= -> $g^((x+$a)(x-$b)) = $g^0 -> (x+$a)(x-$b)= 0 -> x_1=$[-1*$a] V x_2=$b
	!endif
    !endif
 !exit
!endif 

!if $R=3
    # g^(x^2+abx + ab) = 1     
    cijfers=!shuffle 1,2,3,4,5,6,7,8,9,10
    a=!item 1 of $cijfers
    b=!item 2 of $cijfers
    g=!randitem 2,3,4,5,6,7,8,9,10,e
    pm=!randitem -,+
    mp=!randitem -,+
    functie=!exec pari (x $mp $a)*(x $pm $b)
    opgave$n=$g^($functie) = 1
    GOED$n=$[-1*($mp $a)],$[-1*($pm $b)]
    goed$n= -> $g^($functie) = $g^0 -> $functie = 0 -> (x $mp $a)*(x $mp $b) = 0 -> x_1=$[-1*($mp $a)] V x_2=$[-1*($pm $b)] 
 !exit
!endif 

!if $R>3
    # g^(x^2+abx + ab +c) = g^(c)     
    cijfers=!shuffle 1,2,3,4,5,6,7,8,9,10
    a=!item 1 of $cijfers
    b=!item 2 of $cijfers
    c=!randitem 2,3,4,5,6,7,8,9,10
    g=!randitem 2,3,4,5,6,7,8,9,10,e
    pm=!randitem -,+
    mp=!randitem -,+
    functie=!exec pari (((x $mp $a)*(x $pm $b)) + $c)
    opgave$n=$g^($functie) = $g^$c
    GOED$n=$[-1*($mp $a)],$[-1*($pm $b)]
    goed$n= -> $g^($functie) = $g^$c -> $functie = $c -> (x $mp $a)*(x $mp $b) = 0 -> x_1=$[-1*($mp $a)] V x_2=$[-1*($pm $b)] 
 !exit
!endif 
