{%hackmd @cimeesia/ByJDnGiCo %}
# Breaking down the maths behind the Sneaky Snacking
[TOC]
## Intro
Have you ever curious how do those Sneaky Snacking number come ? Have you ever wanted to know the maths behind the scene ?
In this article, I will break down the detail for you, and let you know how to do these maths by yourself.
By the way, here is a [screenshot of Sneaky Snacking panel](https://hackmd.io/_uploads/SJ26Y9f7a.jpg) from my team during the 1st Halloween, and I will use this team to be an example for the following article.
## Section 1: Background info
There are some info we need, we can find out right now.
1. How much Strength would be produce from every single Berry ?
- What level does the Pokemon at ?
- What does the Type for that Pokemon ?
- What does the Specialty for that Pokemon ?
2. How many Berries can be produce each time ?
- Is that Pokemon with Berries Speciality ?
- Does that Pokemon has BFS ?
3. Map Bonus
- Just check your account. :D
4. Strength from Sneaky Snacking
- It has a really high chance to see the Sneaky Snacking panel every time you woke up.
And let's compile these info first, as following shows:
| Nickname | Specialty | Type/Berry | BFS | Level | Strength |
| -------- | ----------- |:--------------:|:---:| -----:| --------:|
| Jack | Berries | Electric/Grepa | No | 34 | 10,824 |
| Mia | Berries | Electric/Grepa | Yes | 17 | 12,006 |
| Rai | Berries | Electric/Grepa | Yes | 15 | 7,590 |
| Tio | Berries | Electric/Grepa | Yes | 12 | 5,508 |
| Ava | Ingredients | Ghost/Bluk | No | 32 | 480 |
*[BFS]: Berry Finder S
:::success
I will put the Answer (Helping Times) here first. Click the "Details" to expand the table.
:::spoiler
| Nickname | Helping Times |
| -------- | ------------- |
| Jack | 66 |
| Mia | 69 |
| Rai | 46 |
| Tio | 36 |
| Ava | 6 |
:::
But these info are still not enough to solve the maths question. We do not only need to figure out the Berry Strength, but also we need to find out how many times of helping that Pokemon provided in last night.
These 2 questions are going to solve just right below.
## Section 2: Berry Strength
In this section, what we need to figure out is, how much Strength the single one Berry would produce.
But unfortunately, the base numbers/Strength of Berry are basically fixed, which is set up by game dev. It seems that it didn't get designed as a data set that has a linear line/curve in maths language. In another words, it has no formula that allowed us to deduce the future Strength (currently).
Even though, there are still some look-up table (LUT) that made by community allowed us to check... or maybe have a look of [this site made by RaenonX](https://pks.raenonx.cc/en/berry).
And let's get to the example, and Rai will be our first experiment.
How many Strength were produced by a single one Grepa Berry ? The answer is 39. Easy. And we are good to go to the next section.

## Section 3: Helping times
Then, as title. In this section, we are going to calculate how many times of Helping that did in the last night ?
Let's check Rai's data again.
| Nickname | Specialty | Type/Berry | BFS | Level | Strength |
| -------- | ----------- |:--------------:|:---:| -----:| --------:|
| Rai | Berries | Electric/Grepa | Yes | 15 | 7,590 |
So, since Rai is Berries Specialty with BFS Sub Skill, we can know that Rai would be produced "$3$" Berries for each Helping.
In addition, we learnt that Grepa Berry would be providing 39 Strength from each single one.
So ... It's time for maths now
$7590 ÷ 3 ÷ 39$...
Wait a moment, don't forget the Map Bonus.
$7590 ÷3 ÷ 39 ÷ 1.4 = 46.337$
Wait again, how come it is a number **with decimal ?** There must be something wrong somewhere. You know, it is impossible to do a 0.3 or 0.5 times of help.
But, we still got a nice info from $46.337$, which is, Rai did ==46== times of help last night.
## Section 4: Berry Strength again but with Rounding
After we got the helping times. Now we can calculate how much Strength Snorlax got from every single Berry now.
$7590 ÷ 3 ÷ 46 = 55$ ?
Okay, this is the Strength of Berry that with Map Bonus, $55$, but where is the decimal ? And yep, as title mentioned, **Rounding**, from the maths.
Before we start to play with rounding, don't forget the Map Bonus. And here it is ...
$39 × 1.4 = 54.6$
Alright, now we know that $54.6$ is the Berry Strength after taking into account the Map Bonus.
Let's do some quick trial and error with some common rounding methods.
| Strength | Rounding | Post-rounding |
| --------:| ------------------ | -------------:|
| 54.6 | Rounding up | 55 |
| 54.6 | Rounding half up | 55 |
| 54.6 | Rounding half down | 55 |
| 54.6 | Rounding down | 54 |
Well... At least now we know it is not using rounding down for Sneaky Snacking.
And let's try some more examples. This time I choose Jack.
| Nickname | Specialty | Type/Berry | BFS | Level | Strength |
| -------- | ----------- |:--------------:|:---:| -----:| --------:|
| Jack | Berries | Electric/Grepa | No | 34 | 10,824 |
After check the Berry's Strength from somewhere, it is $58$ at Lv. 34.
$58 × 1.4 = 81.2$
| Strength | Rounding | Post-rounding |
| --------:| ------------------ | -------------:|
| 81.2 | Rounding up | 82 |
| 81.2 | Rounding half up | 81 |
| 81.2 | Rounding half down | 81 |
And let's see which one is correct.
$10824 ÷ 2 ÷ 1.4 ÷ 58 = 66.65$ (means 66 helping times)
$10824 ÷ 2 ÷ 66 = 82$
Bingo. We don't need more tries now. The ==Rounding up== it is !!!
## Section 5: Full picture of Sneaky Snacking
Finally, we got everything we need now. Let's do the maths one last again.
| Nickname | Specialty | Type/Berry | BFS | Level | Strength |
| -------- | ----------- |:--------------:|:---:| -----:| --------:|
| Rai | Berries | Electric/Grepa | Yes | 15 | 7,590 |
(Berry Strength) × (Map Bonus).
$39 × 1.4= 54.6$
Rounding up this number.
$⌈54.6⌉ = 55$
(post-rounding Berry Strength) × (quantity of fruits from each helping) × (helping times)
$55 × 3 × 46 = 7590$
Yay, it matchs. We find out that how Sneaky Snacking works! Congratulation !
## Thanks for reading
Go check RaenonX's website NOW. It's great! [Pokémon Sleep Info Wiki](https://pks.raenonx.cc/)
-- sia. 2023 Nov 6
### Notes
- 2023 Nov 29, fix some grammar and typo.