petrol car queue question

okay Question There is a queue of N cars waiting at the filling station. 3 fuel dispensers, x, y, z. When a car arrives at front of the queue, driver can choose to go to any dispenser not occupied. If all unoccupied dispensers have less than required by the driver he has to wait. if more than one dispenser has the required liter, the driver chooses the one labeled with the smallest letter....

September 30, 1970 · (updated September 30, 2023) · 3 min · 475 words · Michal Piekarczyk

First i needed to get ruby from homebrew Using gem install bundler jekyll didn’t work for me because I was getting a permission error, ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. I did brew install ruby and brew install rbenv ruby-build Also saw this message (venv3) $ brew install ruby ==> Installing dependencies for ruby: libyaml, openssl@1.1 and readline ==> Installing ruby dependency: libyaml ==> Downloading https://homebrew....

(updated February 26, 2023) · 8 min · 1598 words · michal

Build issues again haha I am doing jekyll build but this time from a Makefile , containing build: jekyll build with make build And I’m getting $ make build jekyll build Traceback (most recent call last): 10: from /usr/local/lib/ruby/gems/2.6.0/bin/jekyll:23:in `<main>' 9: from /usr/local/lib/ruby/gems/2.6.0/bin/jekyll:23:in `load' 8: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:11:in `<top (required)>' 7: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler' 6: from /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler.rb:107:in `setup' 5: from /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:26:in `setup' 4: from /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:26:in `map' 3: from /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:148:in `each' 2: from /usr/local/lib/ruby/gems/2....

(updated February 26, 2023) · 7 min · 1354 words · Michal Piekarczyk

Binomial Distribution Plot Binomial distribution for p, and a sample of n from scipy.stats import binom import numpy as np import matplotlib.pyplot as plt import pylab workdir = '_posts/2020-11-14-georgia-recount-stats_files' fig, ax = plt.subplots(1, 1) n, p = 5, 0.4 mean, var, skew, kurt = binom.stats(n, p, moments='mvsk') x = np.arange(binom.ppf(0.01, n, p), binom.ppf(0.99, n, p)) ax.plot(x, binom.pmf(x, n, p), 'bo', ms=8, label='binom pmf') ax.vlines(x, 0, binom.pmf(x, n, p), colors='b', lw=5, alpha=0....

(updated February 26, 2023) · 1 min · 76 words · Michal Piekarczyk

Here, looking at the recent recount in Georgia as an example around determining, what would a good number of votes to randomly sample to help validate an election result. According to the latest results of this writing there is B, T = 2472182, 2458010 p_observed = B*1./(B + T) # 0.501437 For now just starting off below visualizing the binomial distribution around the p_observed for different numbers of samples to look at what likelihoods are assigned to the different outcomes specified by that given binomial distribution....

(updated February 26, 2023) · 2 min · 277 words · Michal Piekarczyk