@problem@
	@problemtype@
		embedded
	@;problemtype@
	@name@
		tutorial_5_randomness_continued
	@endname@
	@preamble@
		y = randintex(-9,9,[-1,0,1])
		text = randval(["the first entry", "the second entry"])
		z = randval([-1,1])
		greater = randbool()
	@;preamble@
	@content@
		It is often necessary to exclude certain values from being assigned to a variable, e.g. in order to ensure that a problem is solvable or non-trivial. The function call 'randintex(a,b,L)' function yields a random integer between (and including) 'a' and 'b' which is not contained in the list 'L'. For example, in the preamble, 'y' is assigned a random value between -9 and 9 which is not equal to -1, 0 or 1. We can therefore in good conscience pose the following problem:
		@lb;@
		If @y@x = 1, then x = @numericalans(100,1/y)@.
		@pb;@
		The 'randval' function selects a random value from a given list. For example, if you compile this file, you will find that 'text' is @text@ of the list ["the first entry", "the second entry"]. The values in the list given to 'randval' can be numbers as well; for example, the statement |@z@| = 1 must be true, since 'z' is either 1 or -1.
		@pb;@
		The 'randbool()' function call returns either of the values 'True' and 'False' with equal probability. These Boolean expressions can then be used for further computations in the preamble. Within the content, they can be combined with the 'case' function in order to randomly select one of two different cases.
		@pb;@
		In general, the function call 'case(b,first,second)' will return 'first' if 'b' is 'True' and 'second' if 'b' is 'False'. Due to the assigned value for "g" in the preamble, the expression "@case(greater,"greater than","less than")@" will either read "greater than" or "less than". Note that the quotation marks within the function call are not printed, but are used to specify a string argument (cf. Tutorial 2).
		@pb;@
		We can now pose the following problem.
		@lb;@
		If x @case(greater,">","<")@ y, then -x @chooseans(100,[">","<"],case(greater,2,1),display=DROPDOWN)@ -y.
		@lb;@
		Here, if 'greater' is 'True', then the inequality in the problem statement reads "x > y". Then the second answer choice ("<") is the correct one, since -x < y in that case. Similarly, if 'greater' is 'False', then the inequality reads "x < y", in which case the first answer is the correct one.
	@;content@
@;problem@