Skip to content

Instantly share code, notes, and snippets.

@slwu89
Created February 26, 2023 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slwu89/a54ad60c047fad23741213ce7aa09e97 to your computer and use it in GitHub Desktop.
Save slwu89/a54ad60c047fad23741213ce7aa09e97 to your computer and use it in GitHub Desktop.
counting up and down in the most extravagant way possible
using MeasureTheory
using Plots
using Random
function counting(x)
Dirac([x[1]+1, x[2]-1])
end
mc = Chain(x -> counting(x), Dirac([0,0]))
r = rand(mc)
samp = Iterators.take(r, 1000)
plot(transpose(hcat(collect(samp)...)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment