random numbers

random numbers
You can create a random integer with the commands
  • RandomBetween[ 1, 10 ] This command selects an integer between 1 and 10.
  • RandomDiscrete[{1, 2, 3, 4, 5}, {1, 4, 4, 4, 1}] This command uses two lists. The first one contains the possible numbers. The second list gives each umber a probability. In this example the probability to select one of the numbers 2, 3 and 4 is four times as much as the probality to select 1 or 5.
shuffled lists
You can use shuffled lists to add or exclude numbers or to ensure that numbers aren't the same.
  • list1 = Shuffle[{-3, -2, -1, -0.5, 0.5, 1, 2, 3}] creates a list of numbers between -3 and 3 from which 0 is excluded and to which -0.5 and 0.5 are added. The umbers are sorted in a random order.
  • a = list1(1) defines a as the first number in the shuffled list.
  • b = list1(2) ensures that a is not equal to b. This definition makes it possible to define two random but unequal numbers whithin a given range and even exclude or add certain values..
exercises
Try to use random numbers and/or shuffled lists to create numbers following the given conditions.
a random number between 1 and 10.
Font sizeFont size
Very smallSmallNormalBigVery big
Bold [ctrl+b]
Italic [ctrl+i]
Underline [ctrl+u]
Strike
Superscript
Subscript
Font color
Auto
Justify
Align left
Align right
Align center
• Unordered list
1. Ordered list
Quote [ctrl+shift+3]
[code]Code [ctrl+shift+4]
Insert table
Remove Format
Insert image [ctrl+shift+1]
Insert icons of GeoGebra tools
[bbcode]
Text tools
Insert Math
a random number between 1 and 5 with the probability of the even numbers twice as much as the probability of the odd numbers.
Font sizeFont size
Very smallSmallNormalBigVery big
Bold [ctrl+b]
Italic [ctrl+i]
Underline [ctrl+u]
Strike
Superscript
Subscript
Font color
Auto
Justify
Align left
Align right
Align center
• Unordered list
1. Ordered list
Quote [ctrl+shift+3]
[code]Code [ctrl+shift+4]
Insert table
Remove Format
Insert image [ctrl+shift+1]
Insert icons of GeoGebra tools
[bbcode]
Text tools
Insert Math
an even number between 1 and 10
Font sizeFont size
Very smallSmallNormalBigVery big
Bold [ctrl+b]
Italic [ctrl+i]
Underline [ctrl+u]
Strike
Superscript
Subscript
Font color
Auto
Justify
Align left
Align right
Align center
• Unordered list
1. Ordered list
Quote [ctrl+shift+3]
[code]Code [ctrl+shift+4]
Insert table
Remove Format
Insert image [ctrl+shift+1]
Insert icons of GeoGebra tools
[bbcode]
Text tools
Insert Math
an integer between -4 and 4 but not equal to 0 nor to 1
Font sizeFont size
Very smallSmallNormalBigVery big
Bold [ctrl+b]
Italic [ctrl+i]
Underline [ctrl+u]
Strike
Superscript
Subscript
Font color
Auto
Justify
Align left
Align right
Align center
• Unordered list
1. Ordered list
Quote [ctrl+shift+3]
[code]Code [ctrl+shift+4]
Insert table
Remove Format
Insert image [ctrl+shift+1]
Insert icons of GeoGebra tools
[bbcode]
Text tools
Insert Math
two unequal integers between 1 and 5
Font sizeFont size
Very smallSmallNormalBigVery big
Bold [ctrl+b]
Italic [ctrl+i]
Underline [ctrl+u]
Strike
Superscript
Subscript
Font color
Auto
Justify
Align left
Align right
Align center
• Unordered list
1. Ordered list
Quote [ctrl+shift+3]
[code]Code [ctrl+shift+4]
Insert table
Remove Format
Insert image [ctrl+shift+1]
Insert icons of GeoGebra tools
[bbcode]
Text tools
Insert Math
a decimal number between 1 and 10 with 1 decimal
Font sizeFont size
Very smallSmallNormalBigVery big
Bold [ctrl+b]
Italic [ctrl+i]
Underline [ctrl+u]
Strike
Superscript
Subscript
Font color
Auto
Justify
Align left
Align right
Align center
• Unordered list
1. Ordered list
Quote [ctrl+shift+3]
[code]Code [ctrl+shift+4]
Insert table
Remove Format
Insert image [ctrl+shift+1]
Insert icons of GeoGebra tools
[bbcode]
Text tools
Insert Math
Close

Information: random numbers