Examples in the user manual
25. Different data
¿Which function is this?
#p
]]>
1.0000000
0.3333333
0
true
true
none
#r1]]>
#r2]]>
#r3]]>
#r4]]>
#r5]]>
<question><wirisCasSession><![CDATA[<session lang="en" version="2.0"><library closed="false"><mtext style="color:#ffc800" xml:lang="es">variables</mtext><group><maction actiontype="comment"><comment><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>Generate</mi><mo> </mo><mi>one</mi><mo> </mo><mi>data</mi></math></comment></maction><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"><mtable><mtr><mtd><mi>data</mi><mfenced><mrow/></mfenced><mo> </mo><mo>:</mo><mo>=</mo><mo> </mo></mtd></mtr><mtr><mtd><mo> </mo><mo> </mo><apply><csymbol definitionURL="http://www.wiris.com/XML/csymbol">begin</csymbol><mtable><mtr><mtd><apply><csymbol definitionURL="http://www.wiris.com/XML/csymbol">local</csymbol><mtable align="top"><mtr><mtd><mi>b</mi><mo>,</mo><mi>c</mi><mo>,</mo><mi>d</mi></mtd></mtr></mtable></apply></mtd></mtr><mtr><mtd><mi>b</mi><mo>=</mo><mi>random</mi><mfenced><mrow><mn>1</mn><mo>.</mo><mo>.</mo><mn>10</mn></mrow></mfenced></mtd></mtr><mtr><mtd><mi>c</mi><mo>=</mo><mi>random</mi><mfenced><mrow><mo>-</mo><mn>5</mn><mo>.</mo><mo>.</mo><mn>5</mn></mrow></mfenced></mtd></mtr><mtr><mtd><mi>d</mi><mo>=</mo><mi>b</mi><mo>*</mo><mi>x</mi><mo>+</mo><mi>c</mi></mtd></mtr><mtr><mtd><mi>return</mi><mo> </mo><mi>d</mi></mtd></mtr></mtable></apply><mo>;</mo></mtd></mtr></mtable></math></input></command><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"/></input></command><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>correct</mi><mo>=</mo><mi>data</mi><mfenced><mrow/></mfenced></math></input></command><maction actiontype="comment"><comment><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>Here</mi><mo> </mo><mi>we</mi><mo> </mo><mi>must</mi><mo> </mo><mi>make</mi><mo> </mo><mi>the</mi><mo> </mo><mi>wording</mi><mo>,</mo><mo> </mo><mi>using</mi><mo> </mo><mi>the</mi><mo> </mo><mi>correct</mi><mo> </mo><mi>answer</mi><mo>.</mo><mo>.</mo><mo>.</mo></math></comment></maction><maction actiontype="comment"><comment><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>For</mi><mo> </mo><mi>instance</mi><mo>,</mo><mo> </mo><mi>we</mi><mo> </mo><mi>plot</mi><mo> </mo><mi>it</mi><mo>:</mo></math></comment></maction><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>p</mi><mo>=</mo><mi>plot</mi><mfenced><mi>correct</mi></mfenced></math></input></command><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"/></input></command><maction actiontype="comment"><comment><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>Generate</mi><mo> </mo><mi>a</mi><mo> </mo><mi>list</mi><mo> </mo><mi>of</mi><mo> </mo><mn>5</mn><mo> </mo><mi>different</mi><mo> </mo><mi>data</mi></math></comment></maction><maction actiontype="comment"><comment><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>The</mi><mo> </mo><mi>first</mi><mo> </mo><mi>one</mi><mo> </mo><mi>is</mi><mo> </mo><mi>the</mi><mo> </mo><mi>correct</mi><mo> </mo><mi>answer</mi></math></comment></maction><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>L</mi><mo>=</mo><mfenced close="}" open="{"><mtable align="center"><mtr><mtd><mi>correct</mi></mtd></mtr></mtable></mfenced></math></input></command><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"><apply><csymbol definitionURL="http://www.wiris.com/XML/csymbol">for</csymbol><mrow><mi>i</mi><mo> </mo><mi>in</mi><mo> </mo><mn>2</mn><mo>.</mo><mo>.</mo><mn>5</mn></mrow><mtable><mtr><mtd><apply><csymbol definitionURL="http://www.wiris.com/XML/csymbol">local</csymbol><mtable align="top"><mtr><mtd><mi>a</mi></mtd></mtr></mtable></apply></mtd></mtr><mtr><mtd><apply><csymbol definitionURL="http://www.wiris.com/XML/csymbol">repeat</csymbol><mrow><mi>a</mi><mo>=</mo><mi>data</mi><mfenced><mrow/></mfenced></mrow><mrow><mi>a</mi><mo>∉</mo><mi>L</mi></mrow></apply></mtd></mtr><mtr><mtd><mi>L</mi><mo> </mo><mo>|</mo><mo>=</mo><mo> </mo><mfenced close="}" open="{"><mtable align="center"><mtr><mtd><mi>a</mi></mtd></mtr></mtable></mfenced></mtd></mtr></mtable></apply><mo>;</mo></math></input></command><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>L</mi></math></input></command><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"/></input></command><maction actiontype="comment"><comment><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>We</mi><mo> </mo><mi>insert</mi><mo> </mo><mi>an</mi><mo> </mo><mi>open</mi><mo> </mo><mi>option</mi></math></comment></maction><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>L</mi><mrow><mi>random</mi><mfenced><mrow><mn>1</mn><mo>.</mo><mo>.</mo><mn>5</mn></mrow></mfenced></mrow></msub><mo>=</mo><mo>"</mo><mo>[</mo><mi>none</mi><mo> </mo><mi>of</mi><mo> </mo><mi>the</mi><mo> </mo><mi>others</mi><mo>]</mo><mo>"</mo></math></input></command><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"/></input></command><maction actiontype="comment"><comment><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>We</mi><mo> </mo><mi>assign</mi><mo> </mo><mi>the</mi><mo> </mo><mi>list</mi><mo> </mo><mi>to</mi><mo> </mo><mi>the</mi><mo> </mo><mi>answers</mi></math></comment></maction><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced close="}" open="{"><mtable align="center"><mtr><mtd><mi>r1</mi><mo>,</mo><mi>r2</mi><mo>,</mo><mi>r3</mi><mo>,</mo><mi>r4</mi><mo>,</mo><mi>r5</mi></mtd></mtr></mtable></mfenced><mo>=</mo><mi>L</mi></math></input></command><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"/></input></command></group></library></session>]]></wirisCasSession><options><option name="precision">4</option><option name="implicit_times_operator">false</option><option name="times_operator">·</option><option name="imaginary_unit">i</option></options><localData><data name="casSession"/></localData></question>