Skip to content

Instantly share code, notes, and snippets.

# @lbarqueira.bsky.social's random matrix eigenvalue plot
# https://bsky.app/profile/lbarqueira.bsky.social/post/3loccbpcfoc24
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
N=10000000
n=5
@alex1770
alex1770 / catsweeper
Created July 1, 2024 09:54
Rosalind Python programs
import tkinter
import random
gameover = False
score = 0
squarestoclear = 0
size = 10
def play_catfield():
create_catfield(catfield)
window = tkinter.Tk()
@alex1770
alex1770 / coinbijection.py
Last active March 26, 2024 00:05
Make a bijection between Alice's and Bob's wins in coin-tossing game
# Re https://twitter.com/littmath/status/1770236243911000334
# Coin flipping bijection, based on @NoahJSnyder et al's proof
# Original score: HH scores 1 to Alice and HT scores 1 to Bob
# Adjusted score to Bob: as above except (the last) HT only scores 1/2 to Bob if there isn't a later H.
# Using adjusted scores, the number of Alice wins equals the number of Bob wins.
# The function below produces an explicit, though obscure, "local" bijection between Alice's wins and Bob's wins
# that doesn't involve collecting all of them first.
import sys
@alex1770
alex1770 / gent.cpp
Last active April 28, 2018 11:45
Generate tournaments
// Construct all tournaments of size up to 11
// A. P. Selby / April 2018
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <algorithm>
#include <vector>