# Math in Game Development - Measures of Center (Chapter 1)

A very crucial aspect in game development is to see how a game appeals to its community. This tutorial will cover:

• measures of center

• how they are applicable

• calculating information

• most applicable measure of center

• outliers, quartiles, I-QR, range

Notice
Lesson 1a - 3a is similar to a “basic math lesson.” If you would like to skip those lessons, feel free to.

# (1a) Measures of Center - Mean

The mean, commonly referred to as the average, is the calculated “central” value of a set of numbers. To calculate the mean, there are two simple steps:

1. add up all the numbers

2. divide by how many numbers there are

Demonstration related to game development

A data set shows the retention rate of a game (in hours):

• Monday: 336

• Tuesday: 212

• Wednesday: 378

• Thursday: 276

• Friday: 489

• Saturday: 625

• Sunday: 856

The game developer is curious to find the mean of this data set. To find the mean, the developer should refer to the following steps:

``````
336

212

378

276

489

625

856

(Divide it by 7)

…And 453.1* is about what I got. That seems pretty reasonable indeed.

*Rounded to the nearest tenth

``````
Mean FAQs

Q:

Does the mean have to be a number in the data set?

A:

Not necessarily.

Q:

Are there other methods to calculate the mean?

A:

The listed method is the most well-known and efficient method.

Q:

Do decimals make a big impact when calculating the mean?

A:

It’s important to include the exact numbers in a data set when calculating the mean, but rounding to the nearest tenth makes the mean clearer (this applies to everything in this lesson).

Feel free to ask questions, and I will add it to FAQs.

Now we know all this information, but why is the mean important? So what if I know the mean? The mean is great to find the central value of a data set. Looking at multiple numbers has no meaning, but by combining multiple numbers into one, it shows how your data set looks.

Resource for mathematical definition: Mean Definition (Illustrated Mathematics Dictionary)

### (1b) Measures of Center - Mean Absolute Deviation

Maybe there is an outlier in my data set. Well, the outlier can be misleading at times, especially when calculating the mean of a data set. Maybe there is no outlier, but the data set is very diverse. For whatever reason, it is good to calculate the mean absolute deviation.

The mean absolute deviation is the average of how distant a number is from the mean.

Demonstration related to game development

Using the demonstration from lesson 1a, we see this data set:

A data set shows the retention rate of a game (in hours):

• Monday: 336
• Tuesday: 212
• Wednesday: 378
• Thursday: 276
• Friday: 489
• Saturday: 625
• Sunday: 856

The calculated mean was 453.1. On Tuesday, the game had a retention rate of 212 hours. The mean was far off from 212. In the mean absolute deviation, we would do the following:

``````
The average is 453.1. Find the distance every number in the data set is compared to the mean by subtracting.

336 - 453.1 = 117.1.

Do the following procedure for each number in the data set.

Important notice: when subtracting, there are no negative numbers. Always subtract the biggest number from the smallest number.

Once calculating the distance from each number and the mean, find the mean of those numbers, and you have your mean absolute deviation.

``````

No resource available

# (2a) Measures of Center - Median

The median is very simple to calculate. First, order all numbers in your data set from least to greatest and find the middle number. If there are two middle numbers, find the mean of them. Let’s use the data set example in lesson 1a. Now, let’s order them from least to greatest.

Demonstration related to game development
``````The demonstration in lesson 1a included a data sat in chronological order. To calculate the median, the data set must be calculated in least-to-greatest order.

Data set:
336, 212, 378, 276, 489, 625, 856

Least-to-greatest:
212, 276, 336, 378, 489, 625, 856

Median:
378

Well, what if there is two middle numbers?
Refer to the demonstration:
212, 214
Average them out:
213
Median: 213
``````

No resource available

# (3a) Measures of Center - Mode

The mode is very simple. The mode the number in a data set that appears most frequently. To demonstrate this:

Demonstration related to game development
``````A game has had the following amount of new users in specific days:
9, 10, 9, 8, 9, 2, 6

The mode is 9, because 9 made more appearances compared to any number in the data set.
``````
Mode FAQs

Q:

Does there have to be a mode?

A:

If every number in a data set is different, there is no mode.

Feel free to ask questions, and I will add it to FAQs.

No resources available

# (4a) Quartiles, I-QR, Range

There are four quartiles in a data set. However, there are only three quartiles that are worth calculating.

Image credit: Median, Quartiles, Percentiles (video lessons, examples, solutions)
The quartiles 1, 2, and 3 separate four quartiles. The median is also known as quartile 2. Think of the quartiles 1 and 3 like the higher and lower median.

Demonstration related to game development
``````A game has seen that their new update has raised their average retention rate (in hours):
9, 10, 10, 10, 11, 11, 12, 14, 15

Q2/Median: 11
Q1 and Q3 do include the median.

Q1 is the lower half:
9, 10, 10, 10, 11

Q1 is the median of the lower half:
10

Q3 is the higher half:
11, 11, 12, 14, 15

Q3 is the median of the higher half:
12
``````

With the demonstration related to game development, the quartiles 1, 2, and 3 have been found.

Well, what is the "I-QR?"

The I-QR stands for the inter-quartile range. The I-QR is Q3 - Q1. In our demonstration related to game development, the I-QR was 2.

Okay, but how is the I-QR important?

The I-QR will help find outliers, and will give you a better understanding of your data set.

The range is very simple, the range is just the highest number subtracted by the lowest number, or in the demonstration: 15 - 9 = 6, so the range is 6.

No resources available

### (4b) Outliers

The outlier is I-QR1.5. For the demonstration in lesson 4a, the I-QR is 2. 21.5 = 3. Once getting three, subtract it from Q-1 which is 11. You get 8. Any number 8 or less is an outlier. To calculate a higher outlier, do I-QR*1.5, then add that with Q-3. 12 + 3 is 15, so an outlier is 15.

Why is the outlier important?

The outlier is very important. The outlier can be misleading when finding specific measures of center, and maybe give you an undesired image of your data.

No resources available

# (5a) Measures of Center - Which to Use

This isn’t too complicated.

When to use mean: when there is no outlier
When to use median: when there is outlier
When to use mode: when objects like colors or dogs are compared

No resources available

# (6a) How is All This Data Applicable

All this is very important to get a very good understanding of your data, and to make business decisions and calculations. The information provided is crucial for game developers. Maybe a game developer questions about their game’s analytics, well this is the answer.

## Notice

English is a second language to me, I am Italian. Apologies for any grammatical errors.

20 Likes

Fantastic stuff!
A minor typo here though - isn’t the Interquartile Range supposed to be Q3 - Q1?

The I-QR stands for the inter-quartile range. The I-QR is Q1 - Q3. In our demonstration related to game development, the I-QR was 2.

4 Likes

I’m sorry, thank you for the typo. I have now fixed it, and thank you.

3 Likes