Saturday, February 24, 2024

(R) Ethiopian Multiplication


It is unfortunate that Africa is often overlooked as it pertains to the continent’s pre-colonial achievements. In today’s article, we’re going to examine the manner in which Ethiopians once performed multiplication calculations.

Interestingly enough, this method seems to almost purposely avoid the inclusion of decimal figures within its algorithmic components. I’m not sure if this was the result of a greater aversion to irrational figures, or simply just a coincidence of the consequence of its design.

The methodology which I will be referencing throughout this entry can be found below:

“Ethiopian Binary Math | the Engines of Our Ingenuity.” Engines.egr.uh.edu, engines.egr.uh.edu/episode/504. Accessed 24 Feb. 2024.

Example of Method Application

For our example, we will multiply the values of 9 and 115.

If we were to perform this multiplication exercise though the utilization of our modern multiplication algorithm, we would take a far different approach. However, if we were to approach this mathematical inquiry from the Ethiopian perspective, we would take the following steps.


We would begin by recording the first initial value (9), and then record the quotient of that value by dividing by 2, but not before discarding any potential remainder. Next, we would divide that value (4) by 2, recording the quotient after discarding any potential remainder. We would continue this process until our final recorded value was 1.

After having dealt with the first value, we would record the second initial value (115), and then record the product of that value multiplied by 2. Next, we would then record that value’s (115) product after multiplying by 2 (230). We would then continue this process until the number of values within the second column, equals the number of values contained within the first column.

To come to the final sum, we would add all of the values within the Value 2 column which possess a corresponding odd number entry within the Value 1 column.

9 and 1 are both odd numbers, and their corresponding entries are 115 and 920. Therefore, by summing 115 and 920, we reach the value of 1035.

If we were to reverse the order of multiplication, 115 multiplied by 9, as opposed to 9 multiplied by 115, our outcome would not change. Although, the column values would differ.


########################################################################### 

# The first value within the multiplication equation #


val1 <- 115

# The second value within the multiplication equation #

val2 <- 9

########################################################################### 

vec1 <- c()

vec2 <- c()


while (val1 != 0)

{

vec1 <<- c(vec1, val1)

print(val1)

val1 <- val1 - ceiling(val1/2)

}


# Number of observational entries for val1 #

n <- length(vec1)


while (n != 0)

{

vec2 <<- c(vec2, val2)

print(val2)

val2 <- val2 * 2

n <<- (n - 1)

}


# Create data frame #

Eth_Frame <- data.frame(vec1, vec2)


# Function which identifies odd elements within a vector #

odds <- function(x) subset(x, x %% 2 != 0)


# Identify odd elements #

odd_values <- odds(vec1)


# Match odd elements within odd_values vector to Eth_Frame variable 'vec1' #

Eth_Frame$odd_vec <- odd_values[match(Eth_Frame$vec1, odd_values)]


# Remove all observational values in which vec1 = odd_vec within 'Eth_Frame' #

Eth_Frame <- subset(Eth_Frame, Eth_Frame$vec1 == Eth_Frame$odd_vec)


# Sum all remaining elements within variable 'vec2', within data frame 'Eth_Frame' #

sum(Eth_Frame$vec2)

########################################################################### 

Corresponding output:

> sum(Eth_Frame$vec2)
[1] 1035

########################################################################### 

If you would like to see the contents of each column prior to the calculation being completed, print the Eth_Frame to the console prior to defining the odds function. Also, try reversing each value’s entry within the code (val1 <- 9 val2 <- 115), to verify that order does not play a role in determining the algorithm’s outcome.

Final Thoughts

I’m not going to pontificate too deeply on the concept detailed within this entry. However, some scholars have found similarities when comparing this method of multiplication, to the way in which digital computing methodologies handle similar tasks. I do find it fascinating that the genesis of many of the concepts which empower modernity, seem to find their un-actualized origins within prior historic periods.

It is also thought provoking in that, the aversion to zero and irrationality in mathematics which began in Greece, continued to haunt the west, and some western adjacent societies for an absurd duration of time. 

For more on that topic, please refer to the link below: 

Matson, John. “The Origin of Zero.” Scientific American, 21 Aug. 2009, www.scientificamerican.com/article/history-of-zero/.

Until next time.

-RD

Monday, February 12, 2024

(R) Is Taylor Swift’s Presence Significantly Impacting NFL Game Outcomes?


I hope that everyone enjoyed Super Bowl 58. Regardless of the outcome, I hope that we can all agree that the athleticism displayed by both the 49ers and the Chiefs, made this particular game, one for the ages.

I was planning on writing this article even before the contest was decided. However, I feel that it’s more relevant now, given the game’s results.

So, let’s ask the question:

Is Taylor Swift’s Presence Significantly Impacting NFL Game Outcomes (for Kansas City)?

To answer this question, we’ll be employing two separate tests and hypotheses.

Both assessments will utilize the Welch Two Sample T-Test methodology.

Our hypotheses are:

H0: (Null) – There was not a significant difference as it pertains to Kansas City’s total offensive yards per game with Taylor Swift in attendance.

HA: (Alternative) – The was a significant difference as it pertains to Kansas City’s total offensive yards per game with Taylor Swift in attendance.

~ AND ~

H0: (Null) – There was not a significant difference as it pertains to Kansas City’s total yards allowed per game with Taylor Swift in attendance.

HA: (Alternative) – The was a significant difference as it pertains to Kansas City’s total yards allowed per game with Taylor Swift in attendance.



Hogan, Kate. “Every Time Taylor Swift Went to a Kansas City Chiefs Game - and Whether or Not the Team Won.” Peoplemag, PEOPLE, 12 Feb. 2024, people.com/every-time-taylor-swift-went-to-kansas-city-chiefs-game-if-they-won-8410511. 

“2023 Kansas City Chiefs Rosters, Stats, Schedule, Team Draftees, Injury Reports.” Pro, www.pro-football-reference.com/teams/kan/2023.htm. Accessed 12 Feb. 2024.

###########################################################################

CSV File:

,KC - 2023 NFL Season - Team Statistics,,,
Week,Offense (TotYd),Defense (TotYd),Opponent,Taylor Swift (Y/N)
1,316,368,DET,N
2,399,271,JAX,N
3,456,203,CHI,Y
4,401,336,NYJ,Y
5,333,329,MIN,N
6,389,197,DEN,Y
7,483,358,LAC,Y
8,274,240,DEN,N
9,267,292,MIA,N
10,Bye Week,,,
11,336,238,PHI,N
12,360,358,LVR,N
13,337,382,GNB,Y
14,346,327,BUF,Y
15,326,206,NEW,Y
16,308,205,LVR,Y
17,373,263,CIN,Y
18,268,353,LAC,N

###########################################################################

## Code for Testing and Analysis ##

Offense_TotYd <- c(316, 399, 456, 401, 333, 389, 483, 274, 267, 336, 360, 337, 346, 326, 308, 373, 268)

Defense_TotYd <- c(368, 271, 203, 336, 329, 197, 358, 240, 292, 238, 358, 382, 327, 206, 205, 263, 353)

Offense_TotYd_No <- c(316, 399, 333, 274, 267, 336, 360, 268)

Defense_TotYd_No <- c(368, 271, 329, 240, 292, 238, 358, 353)

Offense_TotYd_Swift <- c(456, 401, 389, 483, 337, 346, 326, 308, 373)

Defense_TotYd_Swift <- c(203, 336, 197, 358, 382, 327, 206, 205, 263)

t.test(Offense_TotYd_No, Offense_TotYd_Swift, paired = FALSE, conf.level = 0.95)

t.test(Defense_TotYd_No, Defense_TotYd_Swift, paired = FALSE, conf.level = 0.95)

sd(Offense_TotYd_No)

sd(Offense_TotYd_Swift)

sd(Defense_TotYd_No)

sd(Defense_TotYd_Swift)

###########################################################################


Findings


There was a significant difference as it pertains to Kansas City’s total offensive yards per game (2023) with Taylor Swift in attendance (n = 9), as compared to total offensive yards per game with Taylor Swift not in attendance (n = 8). Kansas City’s total offensive yards per game with Taylor Swift in attendance (M = 379.89, SD =59.23), Kansas City’s total offensive yards per game with Taylor Swift not in attendance (M = 319.13, SD = 47.67), Conditions; t(14.878) = -2.341, p = 0.03.

There was not a significant difference as it pertains to Kansas City’s total yards allowed per game (2023) with Taylor Swift in attendance (n = 9), as compared to total yards allowed per game with Taylor Swift not in attendance (n = 8). Kansas City’s total yards allowed per game with Taylor Swift in attendance (M = 275.22, SD = 75.69), Kansas City’s total yards allowed per game with Taylor Swift not in attendance (M = 306.13, SD = 53.03), Conditions; t(14.294) = 0.98307, p = 0.34.

Conclusions

While Tay Tay’s presence was generally beneficial to the Kansas City Chiefs as it pertains to the assessed metrics (Offensive Yards per Game, Yards Allowed per Game), only the offensive side of the ball saw a significant differentiation in performance (p = .03). Perhaps T. Swizzle provided the Kansas City Chiefs with some extra oomph via her top 40 mojo. Whatever the case may be, Tayla Swiff continues to be a good luck charm for the Chiefs whenever she is in attendance. 

Monday, January 29, 2024

(R) Is Motion Prior to the Snap Correlated with Wins per Season?


The year of our Lord 2023, has been an anemic year as it pertains to NFL offensive prowess. There are numerous articles written as to why this may be the case. I personally believe that it may be due to an over reliance on the passing game. While this approach was optimal throughout prior years, recent defensive innovations devised to temper this phenomenon, have since severely limited its present effectiveness.

There are many methodologies which can be utilized to counteract the effectiveness of newly emergent algorithmic football defenses. The tried and true amongst such, is the application of motion prior to the snap.

In doing research for this article, I stumbled upon the following data:



So, in the spirit of upcoming Super Bowl LVIII (49ers vs Chiefs), let’s analyze this information in order to discern whether team wins are correlated with pre-snap motion.

###########################################################################

# Getting the Libraries in Order (for Graphical Output) #

library(ggpubr)

library(tseries)

# Motion Prior to Snap (through Week 6) #

# Data Collected by ESPNStatsInfo #

# Populate Data Frame #

Team <- c('Dolphins', 'Rams', '49ers', 'Lions', 'Packers', 'Chargers', 'Seahawks', 'Falcons', 'Ravens', 'Titans', 'Giants', 'Bears', 'Chiefs', 'Colts', 'Steelers', 'Texans', 'Jaguars', 'Jets', 'Broncos', 'Vikings', 'Washington', 'Bengals', 'Patriots', 'Buccaneers', 'Cardinals', 'Bills', 'Browns', 'Panthers', 'Saints', 'Raiders', 'Eagles', 'Cowboys')

Motion_Percentage <- c(80.2, 65.4, 77.5, 62.3, 58.3, 55.6, 48.9, 61.1, 49.5, 48, 44.3, 56.1, 68.3, 45.4, 45.4, 52.3, 44.9, 35.5, 38.1, 46.3, 53.2, 44.6, 51.1, 43.9, 39.9, 48.7, 47.3, 35.4, 28.5, 52.9, 21.7, 42.1)

Wins_2023 <- c(11, 10, 12, 12, 9, 5, 9, 7, 13, 6, 6, 7, 11, 9, 10, 10, 9, 7, 8, 7, 4, 9, 4, 9, 4, 11, 11, 2, 9, 8, 11, 12)

Motion_Report <- data.frame(Team, Wins_2023, Motion_Percentage)

# Derive Mean and Standard Deviation #

mean(Motion_Report$Motion_Percentage)

sd(Motion_Report$Motion_Percentage)

mean(Motion_Report$Wins_2023)

sd(Motion_Report$Wins_2023)

# Apply Correlation Methodology $

cor.test(Motion_Report$Motion_Percentage, Motion_Report$Wins_2023)

# Create Graphic Visualizations #

data <- data.frame(Motion_Percentage, Wins_2023)

ggscatter(data, x = "Motion_Percentage", y = "Wins_2023",

add = "reg.line", conf.int = TRUE,

cor.coef = TRUE, cor.method = "pearson",

xlab = "Rate of Motion (Through Week 6)", ylab = "Season Wins (2023)")

###########################################################################


Findings


There was a positive correlation between the two variables: Season Wins (2023) (n = 32) and Rate of Motion (Through Week 6) (n = 32). Season Wins (2023) (M = 8.5, SD = 2.747), Rate of Motion (Through Week 6) (M = 49.772, SD = 12.526), Conditions; t(30) = 1.4809, p = .15. Pearson Product-Moment Correlation Coefficient: r = .26.

###########################################################################

Conclusions

While the p-value findings (p = .15) can be viewed as non-significant at the alpha level of .05, we must take into account that there are certain experimental limitations which will innately confound our results. For one, wins per season is zero sum. Meaning, that a win for one team, is always loss for another. Also, as both motion and wins per season are discrete variables, there is a limited predefined range of differentiation which exists between each variable. This, combined with wins per team being non-independent, reduces the test result to a generalization.

Success of motion implementation is being assessed solely on wins, and the mechanism for generating such is being assessed by offensive motion alone. Our assessment does not account for strength of schedule, team defensive prowess, player fundamentals, etc.

However, that being said, with a p = .15, and a correlation coefficient value of r = .26, it likely is more fortuitous, all things being equal, to implement an offense which possesses pre-snap motion. There certainly are many other factors which can determine outcome which are not assessed within this model, but in all likelihood, they will not have a large impact upon the overall findings.