git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: "Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Anders Höckersten via GitGitGadget" <gitgitgadget@gmail.com>,
	git@vger.kernel.org, "Anders Höckersten" <anders@hockersten.se>
Subject: Re: [PATCH] describe-doc: clarify default length of abbreviation
Date: Sun, 16 May 2021 15:00:21 -0400 (EDT)	[thread overview]
Message-ID: <7ab75f6a-14a8-1aa7-ad0-20f484e2c8@crashcourse.ca> (raw)
In-Reply-To: <60a1699eedcd4_109fc7208e1@natae.notmuch>

[-- Attachment #1: Type: text/plain, Size: 1937 bytes --]

On Sun, 16 May 2021, Felipe Contreras wrote:

> Bagas Sanjaya wrote:
> > On 16/05/21 14.32, Anders Höckersten via GitGitGadget wrote:
> > > @@ -139,8 +140,11 @@ at the end.
> > >
> > >   The number of additional commits is the number
> > >   of commits which would be displayed by "git log v1.0.4..parent".
> > > -The hash suffix is "-g" + unambiguous abbreviation for the tip commit
> > > -of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`).
> > > +The hash suffix is "-g" + an unambigous abbreviation for the tip commit
> > > +of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`). The
> > > +length of the abbreviation scales as the repository grows, using the
> > > +approximate number of objects in the repository and a bit of math
> > > +around the birthday paradox, and defaults to a minimum of 7.
> >
> > What is the birthday paradox then?
>
> It's a probability fact that goes against common sense. In a romm
> with 23 people you are 50% likely to find two people with the same
> birthday.
>
> https://en.wikipedia.org/wiki/Birthday_problem

  i've had to explain the logic behind this to people who really have
a tough time understanding this, and it's a concept that applies in a
lot of places (surprisingly).

  what trips people up is thinking they need to calculate the
probability that two or more people have the same birthday.

  no.

  what you want to do is calculate the ongoing probability that each
person's birthday is *different* from all the earlier ones. as in:

  * prob that 2nd person has a different bday is 364/365
  * prob that 3rd person has a different bday is 363/365
  * prob that 4th person has a different bday is 362/365

and so on, and as you multiply those together, it's right at 23 people
that the chance that that person has a different bday from all earlier
ones drops below 50%.

  what's neat is that this way of looking at things applies in a lot
of places.

rday

  reply	other threads:[~2021-05-16 19:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-16  7:32 Anders Höckersten via GitGitGadget
2021-05-16 11:34 ` Junio C Hamano
2021-05-16 12:00 ` Bagas Sanjaya
2021-05-16 12:47   ` Anders Höckersten
2021-05-16 12:58     ` Junio C Hamano
2021-05-17  5:51       ` Anders Höckersten
2021-05-16 18:51   ` Felipe Contreras
2021-05-16 19:00     ` Robert P. J. Day [this message]
2021-05-16 21:07       ` Felipe Contreras
2021-05-17  5:53 ` [PATCH v2] " Anders Höckersten via GitGitGadget
2021-05-17 16:44   ` Derrick Stolee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ab75f6a-14a8-1aa7-ad0-20f484e2c8@crashcourse.ca \
    --to=rpjday@crashcourse.ca \
    --cc=anders@hockersten.se \
    --cc=bagasdotme@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --subject='Re: [PATCH] describe-doc: clarify default length of abbreviation' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).