TrickJarrett.com

Posts Tagged: math

Veritaseum talks about 6-degrees of separation

Share to: | Tags: math, science, statistics, network theory

Why yes, I'm spending my Friday night learning about higher dimensional geometry for the purposes of D&D worldbuilding. Why? What do you do with your Fridays?

Share to: | Tags: dungeons and dragons, math, geometry

Prime Target on AppleTV

I started watching it because it's about math and stuff. I loved Numb3rs. It's not what I expected, but I am enjoying it.

Also, I'm 95% sure the show concept came from wanting to call a show 'Prime Target.'

Share to: | Tags: streaming, math, appletv

Never Stop Blowing Up's Dice System

So I decided to do some math & coding this morning. I was curious on the distribution of numbers for the exploding dice system used in Dropout's new actual play series: Never Stop Blowing Up

They are using a system built on the Kids on Bikes system, modified to serve the game's theming. The main difference (based on what we've seen) is the dice rolling system.

For Kids on Bikes, you roll the same die when it explodes. For Never Stop, you start with a D4, then on a max roll, you roll again on the next sized dice (D4->D6->D8->D10->D12->D20) adding the combined values of rolls. Roll 1, 2, 3 that's what you get, on a 4, you add 1d6, etc

There's a few more details to what Never Stop is doing, like that it makes it quasi-leveling for the players. Once you explode to a d6, that is now your starting dice roll on that stat, etc. I'm not taking that into consideration for this morning's exploration on the math.

So, looking at every roll beginning with a D4, you have a 25% chance on rolling 1, 2 or 3. Then the remaining 25% chance gets distributed across exploding rolls.

% Range
25% 1-3
4.17% 5-9
0.52% 11-17
0.05% 19-27
0.04% 29-39
0.002% 41-60

You can never roll a 4, 10 (4+6), 18 (4+6+8), 28 (4+6+8+10), 40 (4...12) because those are the threshold numbers an you always add at least 1 to those numbers. This essentially means that everything after these thresholds uses that slot's percentage.

So with 1d4, you have a 25% chance of getting a 4. But since there is no 4, the remaining range of numbers all occupy that 25%. Adding the 1d6 means that you have 25%/6 on each possible roll, except on a 6, that is the percentile chance of the 1d8, etc.

So that's the part I logicked through the math of without any code or simulation. I decided to code a Python script to do large number simulations to see how many times I would roll each number.

from random import randint

dice = [4, 6, 8, 10, 12, 20]

def roll(sides):
    r = randint(1,sides)
    if r == sides and r < 20:
        n = dice.index(sides) + 1
        return r + roll(dice[n])
    return r

def batchroll():
    rolls = []

    for i in range(10000):
        rolls.append(roll(4))

    out = ""
    for i in range(1,61):
        out = out + str(rolls.count(i)) + "\t"

    out = out + "\n"

    with open("rolls.txt", "a") as text_file:
        text_file.write(out)

for x in range(10000):
    batchroll()

(Don't judge the code, I'm sure it could be improved.)

First off, after running it - I was glad to see that I had logicked it all out correctly and the rolls matched expectations. Secondly, seeing actual distribution of numbers was useful for perspective. It's one thing to see them as abstract percentiles, but it's another to see actual numbers of instances.

Out of nearly 100 million simulated rolls, I only rolled on the d20 ~4,300 times. Meaning that with 100,000,000 rolls; I rolled the max of "60" (4+6+...+20) just 203 times. Here's the results of the simulated rolls on a Google Sheet.

Interesting stuff mathematically. A fun morning exercise for the ol' noggin.

Share to: | Tags: dice, python, programming, math

The Irish Logarithm

A fascinating solution found for multiplication of single digit positive numbers, devised for a mechanical calculator.

Share to: | Tags: math

TIL how the Meter was originally defined

From the Wikipedia entry:

The metre was originally defined in 1791 as one ten-millionth of the distance from the equator to the North Pole along a great circle, so the Earth's circumference is approximately 40000 km. In 1799, the metre was redefined in terms of a prototype metre bar. The actual bar used was changed in 1889. In 1960, the metre was redefined in terms of a certain number of wavelengths of a certain emission line of krypton-86.

I had no idea it was defined based off the size of the planet. Love it.

Share to: | Tags: science, math, measurement, metric system

A sense of scale for data amounts

Get a sense of scale for computer storage...

  • Byte of data: a grain of rice
  • Kilobyte: a cup of rice
  • Megabyte: 8 bags of rice
  • Gigabyte: 3 container lorries
  • Terabyte: 2 container ships
  • Petabyte: covers Manhattan
  • Exabyte: covers the UK (3 times)
  • Zettabyte: fills the Pacific Ocean

Share to: | Tags: data, computer, math

Play Set in the browser

Spurred by the video, I decided to look for the game online as something I could play as part of my daily brain games. I found the linked for a simple and straightforward implementation.

Share to: | Tags: math, boardgames, brain game

Diving into the math behind the game 'Set'

Share to: | Tags: math, boardgames

Explaining the "ten dimensions"

This is far from a concluded reality of modern science, but for various reasons I found myself looking to better understand the dimensions beyond the 4 that I can completely understand. This write up was very simple and helped me understand what they each do, in theory.

How does it work? No idea. This only gave me a surface level of the 'what' for each dimension, absolutely nothing for the 'why' or 'how' - which is exactly what I wanted, but I can imagine others who might be looking for those two elements of context as well.

When someone mentions "different dimensions," we tend to think of things like parallel universes – alternate realities that exist parallel to our own, but where things work or happened differently. However, the reality of dimensions and how they play a role in the ordering of our Universe is really quite different from this popular characterization.

To break it down, dimensions are simply the different facets of what we perceive to be reality. We are immediately aware of the three dimensions that surround us on a daily basis – those that define the length, width, and depth of all objects in our universes (the x, y, and z axes, respectively).

Beyond these three visible dimensions, scientists believe that there may be many more. In fact, the theoretical framework of Superstring Theory posits that the universe exists in ten different dimensions. These different aspects are what govern the universe, the fundamental forces of nature, and all the elementary particles contained within.

Share to: | Tags: physics, science, math

The Tau manifesto

Pi or Tau. Its how you start fights with mathematicians. This page lays out the case for the rise of Tau over Pi.

Share to: | Tags: math, tau, pi

2023 is not a prime

My brain woke up ungodly early this morning and it was off to the races. Work, life, philosophy, and... math.

I laid in bed, trying to fall back to sleep, but found my mind wandering. I asked, "Is 2023 prime?" I was surprised to discover: No. When I realized 7 was a divisor of it.

Divisors: 1, 7, 17, 119, 289, 2023

Share to: | Tags: math

Go First Dice

"Go First Dice" are a set of dice that allows some number of players to each roll a different single die (picked arbitrarily from the set) and the following conditions hold:

  1. There will never be ties.
  2. Each possible ordering of the players (determined by highest result, next highest result, etc) has a mathematically equal chance of occurring.
  3. The above conditions hold for every subset of the whole set.

They found a set of 4-dice which works, but have yet to find a set that is fair for groups of 5 or more players. Fascinating math discussions, even if I only understand 2/3rds of it.

Share to: | Tags: math, gaming, dice

Any three digit multiple of 37 is still divisible by 37 when the digits are rotated. Is this just a coincidence or is there a mathematical explanation for this? : askscience

From top commenter MycoNot:

Because 37 is a prime divisor of 999, and rotating a three digit number is a cyclic modulation. Same thing happens with 4 digit multiples of 101 or 11 - although it's a little less impressive rotating multiples of 101 like 4545 to 5454, etc, rotating multiples of 11 is neat like: 11x123=1353, 11x321=3531, 11x483=5313, 11x285=3135.

Five digit multiples of 41 or 271 will work too

Share to: | Tags: math, wizardry