diff --git a/samplequestions/stackdemo/35_odd_even_functions.xml b/samplequestions/stackdemo/35_odd_even_functions.xml new file mode 100644 index 00000000000..74f6f710282 --- /dev/null +++ b/samplequestions/stackdemo/35_odd_even_functions.xml @@ -0,0 +1,437 @@ + + + + + + Odd and even functions + + + 1. Give an example of an odd function by typing an expression which represents it. \(f_1(x)=\) [[input:ans1]]. [[validation:ans1]] [[feedback:odd]]

+

2. Give an example of an even function. \(f_2(x)=\) [[input:ans2]]. [[validation:ans2]] [[feedback:even]]

+

3. Give an example of a function which is odd and even. \(f_3(x)=\) [[input:ans3]]. [[validation:ans3]] [[feedback:oddeven]]

+

[[feedback:poly]]

+

4. Is the answer to 3. unique? [[input:ans4]] (Or are there many different possibilities.) [[validation:ans4]] [[feedback:unique]]

]]>
+
+ + A function \(f\) is odd if +\[ f(x)=-f(-x) \forall x.\] +An example is \(f(x)=4x^3\).  Indeed, polynomials with only odd powers are fine.

+

A function \(f\) is even if \[ f(x)=f(-x) \forall x.\] +An example is \(f(x)=5x^4\).  Indeed, polynomials with only even powers are fine.

+

It is possible to have both \[ f(x)=f(-x)=-f(-x) \] in which case \(f(x)=0\) for all \(x\). This example is unique. +

]]>
+
+ 5 + 0.3333333 + 0 + + + 2026010500 + + + + + + + + + + + + + + 1 + 0 + 0 + + Correct answer, well done.]]> + + + Your answer is partially correct.]]> + + + Incorrect answer.]]> + + . + *10 + dot + 1 + i + cos-1 + lang + [ + 0 + + + ans1 + algebraic + x^3 + 15 + 1 + 0 + + 0 + + + 1 + 1 + 1 + 1 + 3 + + + + ans2 + algebraic + x^4 + 15 + 1 + 0 + + 0 + + + 1 + 1 + 1 + 1 + 3 + + + + ans3 + algebraic + 0 + 15 + 1 + 0 + + 0 + + + 1 + 1 + 1 + 1 + 3 + + + + ans4 + boolean + true + 15 + 1 + 0 + + 0 + + + 1 + 1 + 1 + 0 + 0 + + + + even + 1.0000000 + 1 + 1 + + sa:ans2-subst(x=-x,ans2); + + + 0 + + AlgEquiv + sa + 0 + + 0 + = + 1 + + -1 + even-0-T + + + + = + 0 + + -1 + even-0-F + + Your answer is not an even function. Look, \[ f(x)-f(-x)={@sa@} \neq 0.\]

]]>
+
+
+
+ + odd + 1.0000000 + 0 + 1 + + sa:ev(subst(x=-x,ans1)+ans1,simp); + + + 0 + + AlgEquiv + sa + 0 + + 0 + = + 1 + + -1 + odd-0-T + + + + = + 0 + + -1 + odd-0-F + + Your answer is not an odd function. Look, +\[ f(x)+f(-x)={@ans1@} + {@subst(x=-x,ans1)@} \]

+\[ ={@ans1@} + {@ev(subst(x=-x,ans1),simp)@}={@sa@} \neq 0.\]

]]>
+
+
+
+ + oddeven + 2.0000000 + 1 + 1 + + sa1:subst(x=-x,ans3)+ans3; + sa2:ans3-subst(x=-x,ans3); + + + 0 + + AlgEquiv + sa1 + 0 + + 0 + = + 0.5 + + 1 + ODD + + + + = + 0 + + 1 + oddeven-0-F + + Your answer is not an odd function. Look, \[ f(x)+f(-x)={@sa1@} \neq 0.\]

]]>
+
+
+ + 1 + + AlgEquiv + sa2 + 0 + + 0 + + + 0.5 + + -1 + EVEN + + + + + + 0 + + -1 + oddeven-1-F + + Your answer is not an even function. Look, \[ f(x)-f(-x)={@sa2@} \neq 0.\]

]]>
+
+
+
+ + poly + 1.0000000 + 1 + 0 + + sa:all_listp(polynomialpsimp,[ans1,ans2]); + + + 0 + + AlgEquiv + sa + true + + 0 + = + 1 + + -1 + poly-1-T + + Perhaps you could think of some non-polynomial examples as well?

]]>
+
+ = + 0 + + -1 + poly-1-F + + + +
+
+ + unique + 1.0000000 + 1 + 1 + + + + + 0 + + AlgEquiv + ans4 + true + + 0 + = + 1 + + -1 + unique-0-T + + + + = + 0 + + -1 + unique-0-F + + + + + + + 1 + + + ans1 + x^3 + + + ans2 + cos(x) + + + ans3 + 0 + + + ans4 + true + + + even + 1.0000000 + 0.0000000 + even-0-T + + + odd + 1.0000000 + 0.0000000 + odd-0-T + + + oddeven + 1.0000000 + 0.0000000 + EVEN + + + poly + 0.0000000 + 0.3333333 + poly-1-F + + + unique + 1.0000000 + 0.0000000 + unique-0-T + + + + 2 + + + ans1 + x^2 + + + ans2 + x^3 + + + ans3 + x^3 + + + ans4 + false + + + even + 0.0000000 + 0.3333333 + even-0-F + + + odd + 0.0000000 + 0.3333333 + odd-0-F + + + oddeven + 0.5000000 + 0.3333333 + oddeven-1-F + + + poly + 1.0000000 + 0.0000000 + poly-1-T + + + unique + 0.0000000 + 0.3333333 + unique-0-F + + +
+ +
\ No newline at end of file