Other Natural SciencesQuarto

Data & Molecule Bits

Provides tutorials alongside practical examples in R. Topics include statistical simulations, data visualization, and common challenges in scientific analysis. The content is designed to offer useful insights for those working with data, without unnecessary complexity.
Home PageRSS Feed
language
Published
Author Giorgio Luciano

In this blog post, we will dive into the fascinating world of coin flip sequences. Leveraging the capabilities of R, we will conduct simulations to gain insights into the probabilities of consecutive sequences of heads or tails. Let’s kick things off by simulating coin flips using R. We’ll conduct experiments with varying numbers of flips to observe how the results evolve.

Published
Author Giorgio Luciano

Have you ever wondered why casinos seem to have a mysterious edge, making them consistently profitable? Let’s explore a paradox in the world of gambling, where the number zero takes center stage and helps the house always come out on top. To illustrate this phenomenon, let’s simulate the game of roulette using the R programming language. We’ll focus on a simple bet: predicting whether the ball will land on red or black.

Published
Author Giorgio Luciano

Today, we embark on a visual exploration of card shuffling, delving into a captivating technique known as the Faro shuffle. Unlike conventional shuffling, the Faro shuffle promises not just randomness but a mathematical symphony that unfolds card by card, a dance that echoes with the precision of numbers. In the quest to unravel the intricacies of card shuffling, we turn to the Faro shuffle, a technique that mimics the graceful dance of cards.

Published
Author Giorgio Luciano

The Monty Hall problem is a famous probability puzzle. In this scenario, a contestant on a game show is presented with three doors. Behind one door, there is a car, while behind the other two, there are goats. The contestant chooses one door, and then the host, Monty Hall, who knows what is behind each door, opens one of the remaining two doors to reveal a goat.

Published
Author Giorgio Luciano

Dice rolling is a pastime enjoyed by many, whether in board games or games of chance. But have you ever wondered how the sum of multiple dice rolls behaves when you roll them repeatedly? In this blog post, we embark on a journey into the world of dice rolls and the fascinating Central Limit Theorem. We’ll uncover how the sum of dice rolls can transform into a Gaussian distribution as the number of rolls increases.

Published
Author Giorgio Luciano

Anscombe’s Quartet, known as the “Anscombe’s Test,” consists of four datasets with very similar descriptive statistics but visually distinct characteristics. These quartets serve as an enlightening example of the importance of visualizing data before drawing conclusions. In this post, we will delve into how to calculate and visualize Anscombe’s Quartet using R and the powerful ggplot2 library.

Published
Author Giorgio Luciano

The Birthday Paradox is a probabilistic problem concerning the likelihood that two people in a group share the same birthday. At first glance, it might seem like the probability is very low, but in reality, it’s higher than you might think. The paradox is based on the fact that there are many possible combinations of people’s birthdays within a group.

Published
Author Giorgio Luciano

library(viridis) # Import the viridis color palette library library(ggplot2) set.seed(123) # Set a seed for reproducibility num_flips <- 50000 flips <- sample(c("Heads", "Tails"), num_flips, replace = TRUE) # Image aspect ratio aspect_ratio <- 1 # You can customize the aspect ratio here n_col <- round(sqrt(num_flips) * aspect_ratio) n_row <- ceiling(num_flips / n_col) # Create a color matrix to represent coin flips colors <-

Published
Author Giorgio Luciano

List of packages I’ve found useful in my workflow during 2022 (in no particular order) Plot ggvoronoi: Voronoi Diagrams and Heatmaps with ‘ggplot2’ tags : #ggplot #tidyverse #voronoi [cran package link] https://CRAN.R-project.org/package=ggvoronoi description from the author/vignette ggh4x: Hacks for ‘ggplot2’ tags : #ggplot #tidyverse [cran package link]