hello
i'm here to talk about my mega favorite
number what's a mega favorite number
well uh on youtube right now everyone's
talking about their favorite number
that's
over one million. It's pretty good fun. If
you think you might have a favorite
number that's over one million you
should join in
So what is my mega fave number? It's
44 220 464.
but what the heck is this number? where
did it come from?
so in order to tell you that, first i
have to talk about
chorded keyboards
so assuming you know nothing about a
chorded keyboard
it's like a regular keyboard in that it
can
you know
type things into your computer
um but you might notice
the distinct lack of very many keys
so the the word chorded in chorded
keyboard
kind of comes from in music you play
a single key that's just one tone
but if you play multiple tones at the
same time
that's a chord and so likewise with
a chorded keyboard you know it's not
just
one key represents one letter you can
press
different keys at the same time and you
get a different letter than if you
pressed
each of the individual keys
this is a my chorded keyboard that i
built based on
the asetniop project
which uh quite interesting put together
by
Zach Dennis so there's tons of stuff to
read and play with
online with that i'll put some links in
the comments
so when i first programmed this corded
keyboard
i just
had the naive impression of
uh once a key is pressed down
uh then start recording any other keys
that get pressed down
and once all of the keys are released
then look at any keys that were pressed
down and that's what the chord is.
um but as it turns out typing on a
keyboard like that
um with you know a regular keyboard you
can press down the t
key and then you can press down the h
key before you finish
releasing the t key and it gives us kind
of flow to your
typing but with a chorded keyboard that
you have to release all the keys
before pressing the next keys this is
very gya gya gya gya kind of not so good
so the next thing i put in was
a mode to look at how long each key is
pressed for
and compare it to how long each of the
other keys
or chords were pressed for and then use
that to determine
which chords are meant to have been
pressed and which chords
are meant to have been ignored um so i
put in an
interactive demo mode to sort of show
you how this works
um and so
i'll do e-r-e i find is a very good
example
because it's pressing down this key for
e
then pressing down both of the keys
together for r
and then releasing for an e again so
like this
now in this graph you can see there
the e was pressed down as you saw
right here that's the length of time
then the r was pressed down for a
length of time
and then the e was pressed down for a
length of time
which is pretty cool obviously it's a
lot faster to type
like that than to type
um the same thing goes for chords that
are unrelated to one another if you
don't finish releasing a chord before
pressing the next chord
like in uh t and an
h
so you see down uh here we got a th
but what the keyboard actually saw was
the chord for t
pressed for this length of time then the
chord for b
pressed for a very small amount of time
and then
the chord for h pressed for the longest
amount of time
and then a very very small amount of
time the chord for n was pressed
before all of the chords were released
and it sent through
its decision i wanted a t and an h
so that uh that was my sort of
second development after just having
regular chords that you release
but of course i got daydreaming about
other ways
other extensions so one that i was
thinking
is not that you're pressing down a
specific chord
but that you're pressing down chords in
a kind of a
sequence so you might be pressing
this key and then this key
or pressing both of the keys at the same
time or
pressing this key and then this key
and so i kind of got thinking of a chord
not as
a you know
combination of keys but as a sequence of
keys
but of course if you start extending
this out past just two keys pressed down
then it becomes very sort of cumbersome
it gives you a very very large
combination of patterns that you can put
in
um but
it becomes no longer like a feeling of
to tap but a feeling of
trying to remember individual keys
that is the next one to press or release
so then i thought if you're
having to take the time to remember the
keys to press and release then it's just
as good to try and remember
a chord to press in the sequence
and release so that's how i came to
the idea that the most reasonable
extension to this
system is to have chord sequences!
um also modes would be good but that's
out of the scope of what i'm talking
about today
so then my question
very topical (because #MegaFavNumbers) um
was can i count how many possible
sequences
i can press with a given
amount of key presses
um and
that's what led me to doing a bunch of
math blah blah blah
make a favorite number.
So how do i think of a
chord sequence in order to try and
quantify exactly how many chord
sequences there are?
um so basically uh
there are given states of amount of keys
or chords that are pressed and then
there are transitions
from one chord
being pressed to another chord being
pressed to another chord being pressed
and so i can quantify
the amount of possible chord sequences
for any given amount of transitions. It
turns out
that the exact chord doesn't really
matter
what matters is how many keys are
pressed down for that chord
because in the example of like three
keys
if you press this one down then if
you're going to press down
another key you have two options if you
press down this key
then to press down another key you have
two options
and to press down this key
you then have two options so
really you only need to know how
many possible ways there are to
transition
from having um
an amount of keys pressed to another
amount of keys pressed
on a keyboard with a given number of
keys
so i first started thinking about this
just
drawing transition diagrams here's a
keyboard
that has two keys on it
so zero keys are pressed one key is
pressed
all two keys are pressed so for the
initial state
there's no possible ways of having
pressed one key
no possible ways of having press two
keys and there's one possible way
of having pressed no keys because it's
the starting state of not having pressed
any keys yet
so then i
made up the kind of key transition
matrix
of going from zero keys
to any number of other keys so
from zero to zero there's no transition
that gets you from zero to zero because
you're already
not pressing any keys however to press
one key down
there's two possible transitions press
one key or press the other key
and then to press two keys there's only
one possible transition
press on both. Then if you have
one key pressed down then there's only
one way to get back to zero keys
releasing that key that you pressed
there's no way to get
to one key pressed because if you
press the other key now you have two
keys
if you release that key now you have no
keys so there's no way to transition
from the amount of keys you have to the
same amount and that follows through for
any amount of keys
no matter what you can't transition from
an amount of keys
to pressing the same amount of keys
because you haven't
made any state transition uh
so then finally to get from pressing
down one key
to um pressing m2 keys there's only one
way to do it
pressing the other key and finally
um for having two keys pressed down
you can release both of them that's one
transition
getting back to zero keys pressed or you
can
release either of the two keys which is
two transitions
so then for each of the transitions in
the sequence
you just multiply this matrix by the
different amount of ways that were
already there
to get to the previous transition
uh so the first one you get
you could push down either one of the
two keys
or push down both of the two keys
and that gets you to zero ways
of having made one transition uh
two ways of having press one key and one
way
of having pressed two keys then
if you multiply the now...
or actually this almost caught me
you don't multiply having pressed zero
keys
because if you ever get to the state of
having pressed zero keys
you've ended the sequence essentially
sending through the chord to the
computer
so you have to make sure after the first
transition to no longer include zero
keys
back into the sequence
but anyways so having one key pressed
down
in one of two possible ways you can then
release it which gives you
two sequences that end at
no keys pressed one sequence two
sequence
um or you can press the other one which
gives you another two sequences
one two
and those of course end with two keys
pressed
then finally for having pressed both
keys
you can release both keys that's one
sequence
or you can release either one of the
keys
that's one sequence two sequences
and so carrying on in this way you can
get the number of
sequences possible to end at the zero
state
after one
two transitions or three transitions or
four transitions
or so on and so forth
so putting that into a kind of formal
math notation
um apparently this
transition is described by
the binomial coefficient formula
which is n keys
and total keys choosing
k keys from those n possible
keys uh and it's calculated out with the
formula
n factorial over k factorial
multiplied by n minus k factorial
which i sort of reason is the possible
permutations of all possible keys
divided by possible permutations of
the selected keys and
multiplied by the possible permutations
of unselected keys
uh what does that mean i don't really
know i find
binomial coefficient formula very
interesting
and kind of enigmatic but i trust that
it does give you
the number of combinations of k keys
selected from n
elements so using that to calculate
the different transitions
in our transition matrix we have
the number of ways with k keys
on your keyboard to go from
b keys pressed before too a
keys pressed after is this piecewise
function
where we have if b is greater than a
that is we had more keys pressed down
and we released some of them
is a selection out of
the number of keys that were pressed
down
so you know if you have four keys on
your keyboard
and you have three of them pressed down
and you're releasing keys it doesn't
matter that you have one already
released
you can't release it anymore
and then you select from that the
number of keys you pressed before
subtracting the number of keys you have
pressed after
gives you the number of keys that you
released
so then if b is equal to a
as we've already seen there's no
transition
so it's zero possible ways
and finally if b
is less than a you had less keys pressed
and you pressed some of them uh
then that's you know pressing
selecting from k minus
the already pressed keys you can't as
before
press a key that's already pressed
and we select the
number of keys pressed after subtracting
the number of keys pressed before. that
is to say
the number of keys that were pressed
during this transition
and so finally the
number of chord sequences
after t transitions
uh ending at a
amount of keys pressed
notably this will be zero a lot of the
time
because what we care about is the number
of
ways to complete a sequence and return
to pressing no keys but anyways
that's the sum of all of the
keys before
from having no keys pressed uh
so actually don't keeps pressed is
discounted after the first transition
um all the way through having all of the
keys pressed
uh where we multiply the number of ways
of that previous state the state
at transitions minus one by
the ways of having gotten to
um this
uh the state after that transition
from the state before as per the uh
previous formula uh
and the the transition matrix
so obviously this would be a bit of work
to calculate out manually so
i wrote a program to do it for you um
it's hosted on github so you can see the
link to it down below if you want to
play around with
it uh yeah
so let's put in for, relevant to this
keyboard,
eight keys and run the simulation
so first of all it shows up our
transition matrix here
you see zeros all the way across
um and when i started seeing these i was
very surprised
that i didn't realize earlier that we
would have
pascal's triangle showing up here and
upside down pascal's triangle
showing up here
math has stuff everywhere connected that
i don't realize until i stumble into it
it's great uh so anyways after that
it shows you your chord transition
sequence
from the zero transition as i showed you
down to transition one
so let's get some more transitions
transition two
that's the number of chords that were
on my original keyboard where you had to
press all of the keys
and then release all of the keys which
was 255
enough to make a fully functional
keyboard as you can see
but not so many compared to if we had
say
a sequence that goes a little bit
further
ah there we go after five transitions
so that's like pressing a key pressing a
key pressing a key
pressing a key and releasing
uh we get up to my mega favorite number
44 220 464.
and yes i selected that as the lowest
uh number that was over
1 million from this sequence which of
course keeps going and
gets very very big quite quickly
but i think remembering a sequence of 12
chords
so that you could uh have
this many possible letters to put into
your computer
would start uh stretching the
human hardware side of things but
i think it's quite interesting and
certainly
should be possible to memorize sequences
of chords with only
three transitions in your sequence you
get
12 000 different inputs
you could have and then up to
uh 700 000
and then of course my mega favorite 44
million 220 464
possible sequences
oh thank you for watching
um hope you enjoyed
go ahead and think up your own mega
favorite number
if you don't already have one... who
doesn't already have a mega favorite
number?
it's uh quite a bit of fun
