Documentation / CalcMe

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • Wiris Quizzes

      • Learning Lemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Miscellaneous

                      • Wiris Integrations

                        • Home
                        • CalcMe
                        • Basic guide to CalcMe
                        • Basic guide to CalcMe

                        Randomness

                        Reading time: 1min

                        Nota

                        As you may use these commands to generate an algorithm for a WirisQuizzes question, we show how to create them through the sheet and using the code editor. You can see more details about it here.

                        The random function in CalcMe is adaptable to many cases of use. For example, you will see how to remove the "0" from a random selection. The normal command would be like:

                        CalcMe sheet CalcMe code editor

                        By default, this includes all of the numbers between -10 and 10. If given the requirements of the question, the number 0 needs to be excluded from the set, you can remove it with one simple instruction:

                        CalcMe sheet CalcMe code editor

                        You have to add brackets around the first list for this to work. This can, of course, work equally for any other number you need to exclude other than zero:

                        CalcMe sheet CalcMe code editor

                        The above would produce a random number between -10 and 10, except the number 8. You can even do this with more than one number:

                        CalcMe sheet CalcMe code editor

                        This would remove 8,-8, and 0 from the selection. As you can see, there are many more options when creating a random variable. So far, you have retrieved integer numbers, but you can also work with real numbers.

                        CalcMe sheet CalcMe code editor

                        As a general rule, these real numbers will have as many decimal or significant figures as defined in the Application settings. You can adjust it by defining the step between the possible random values.

                        CalcMe sheet CalcMe code editor
                        CalcMe sheet CalcMe code editor

                        Atenció

                        As you may have seen, we can use {} and [] to exclude several numbers for the set of possible values when generating random variables. We use each of them as follows:

                        [] define arrays and matrices (arrays are supposed to contain the same data types).

                        {} define lists (lists can have different data types).

                        The random function can exclude values as long as the two parameters you pass are in the same format. In other words, if you include a list as a first parameter, you should pass a list as the second parameter as well.

                        Was this article helpful?

                        Yes
                        No
                        Give feedback about this article

                        Related Articles

                        • Basic guide to CalcMe
                        • Arithmetic
                        • Statistics
                        • Probability
                        • Combinatorics

                        Randomness

                        Nota Atenció

                        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 Settings
                        • Cookie Policy
                        • Terms of Use
                        • Privacy Policy / GDPR
                        • Student Data Privacy
                        • Compliance
                        • Powered by Helpjuice
                        Expand