Documentation / WirisQuizzes

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • Wiris Quizzes

      • Learning Lemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Home
                    • Wiris Quizzes
                    • Advanced Validation Features
                    • Advanced use of random variables
                    • Advanced use of random variables

                    Variables from the answer

                    Reading time: 1min

                    Random lineal system resolution

                    We will create a question asking the students for the system's A·x=b solution, being A a random 3x3 matrix and b a random vector. First, we need to write the algorithm of the question in a similar way as the last one.

                    The question's solution will be given in the following way.

                    Notice the possibility of the answer vector xnot being in integer form. Theoretically, this should not be a problem for the students, but we can be interested in an integer answer to make the calculus made by the students less tedious. In order to solve this problem, we can define A as a matrix with determinant 1 as we can see in the next example.

                    Thus, even though we manage to arrange the problem, we are generating a random matrix since we find one with determinant 1, which is very inefficient. In order to optimize our algorithm, we should change our approach to the question. Instead of defining randomly the matrix A and the vector b, we will define our solution and then find an integer matrix A and an integer vector b satisfying A·x=b.

                    This new perspective about how we are defining the question's random parameters will allow us to control how the student answer is going to be.

                    Caution

                    Recall we need to precede the name of a variable with the pound sign # every time we want to call it outside CalcMe. Thus, we must write #sol in the correct answer tab and #A, #b in the statement.

                    Random polynomial roots

                    We will create a question asking the students for the roots of a random polynomial with a random degree. First, we need to write the algorithm of the question.

                    Notice that the algorithm could generate unwanted polynomials, whether it lacks real roots or the difficulty of finding them by hand, as we can see in the following example.

                    Tip

                    You can find more detailed information about answers in lists or sets mode here.

                    In order to arrange it, we can define the polynomial as a product of its roots, as in the example below.

                    This way, all the polynomial roots are integers, and the students will be able to find them as we can see then.

                    Caution

                    Recall we need to precede the name of a variable with the pound sign # every time we want to call it outside CalcMe. Thus, we must write #sol in the correct answer tab and #p in the statement.

                    Was this article helpful?

                    Yes
                    No
                    Give feedback about this article

                    Related Articles

                    • Variables evaluation
                    • Transferring variables to CalcMe
                    • Example: Volume of a cylinder

                    Variables from the answer

                    Random lineal system resolution Caution Random polynomial roots Tip Caution

                    Making people’s STEM work more meaningful

                    MathType

                    • MathType for Office Tools
                    • MathType for Mac
                    • MathType for Microsoft 365
                    • MathType for Google Workspace
                    • MathType for LMS
                    • MathType for XML Editors
                    • Arabic notation
                    • Our products accessibility
                    • MathType is online

                    WirisQuizzes

                    Learning Lemur

                    Solutions for Education

                    • Blackboard Learn
                    • Brightspace by D2L
                    • Canvas
                    • Google Classroom
                    • Moodle
                    • Schoology

                    Solutions for Publishing Houses

                    Solutions for Technical Writers

                    Solutions for Chemistry

                    Integrations

                    • HTML Editors
                    • MathType in WordPress

                    Pricing

                    Company

                    Careers

                    Blog

                    Contact Us

                    Buy Now

                    Plugin Downloads

                    © Wiris 2025

                    • Cookie Preferences
                    • Cookie Policy
                    • Terms of Use
                    • Privacy Policy / GDPR
                    • Student Data Privacy
                    • Compliance
                    • Powered by Helpjuice
                    Expand