Error
There was an error loading the page.
Metadata
-
England schools
-
England university
-
Scotland schools
Taxonomy: mathcentre
Taxonomy: Kind of activity
Taxonomy: Context
Contributors
Feedback
From users who are not members of Hayley's workspace :
![]() |
said | Ready to use | 9 years, 7 months ago |
History
Christian Lawson-Perfect 9 years, 7 months ago
Gave some feedback: Ready to use
Christian Lawson-Perfect 9 years, 7 months ago
Saved a checkpoint:
Rewrote to do what I said below.It's a bit cleverer than that - it generates a uniform random set of data, picks one of the (possibly more than one) modes of the set, and adds another copy to make the mode unique.
Christian Lawson-Perfect commented 9 years, 10 months ago
Actually, it's not impossible that the mode of the generated data is something other than the value you generate. A couple of ways of fixing this:
- write a function to calculate the mode of the data, and add a condition (in the variable testing tab) which insists that the mode is mode1
- shuffle the range 1..20 and take the first, say, 5 values. Make a list with the first three values once, the fourth value twice, and the fifth value three times. Then you know that the mode is the fifth value.
Christian Lawson-Perfect commented 9 years, 10 months ago
Have a look at the table function as a nice way to present data, and generate it in lists.
For example, the first set of data could be generated as
data = shuffle(repeat(random(1..20 except mode1),7)+[mode1,mode1,mode1])
and then displayed withtable(data)
.
Hayley Moore 9 years, 10 months ago
Created this.Name | Status | Author | Last Modified | |
---|---|---|---|---|
Descriptive Stats (P): Mode | Ready to use | Hayley Moore | 01/06/2016 09:47 | |
James's copy of Descriptive Stats (P): Mode | Ready to use | James McEvoy | 10/09/2019 13:41 | |
Descriptive Stats (P): Mode | draft | Xiaodan Leng | 11/07/2019 07:03 |
Name | Type | Generated Value |
---|
values1 | list |
[ 18, 11, 10, 16, 20 ]
|
||||
mode1 | integer |
18
|
||||
show_values1 | list |
[ 10, 11, 18, 20, 16, 18 ]
|
Name | Type | Generated Value |
---|
values2 | list |
List of 8 items
|
||||
mode2 | integer |
15
|
||||
show_values2 | list |
List of 9 items
|
Name | Type | Generated Value |
---|
Generated value: list
[ 18, 11, 10, 16, 20 ]
This variable doesn't seem to be used anywhere.
Use this tab to check that this question works as expected.
Part | Test | Passed? |
---|---|---|
Number entry | ||
Hasn't run yet | ||
Number entry | ||
Hasn't run yet |
This question is used in the following exams: