Recent

Author Topic: 21237.0 as TDateTime  (Read 1198 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 16653
  • Kallstadt seems a good place to evict Trump to.
21237.0 as TDateTime
« on: February 21, 2024, 07:54:26 am »
Since the above TDateTime value is today exactly many moons ago (66) I treated myself on a little teaser, after the coffee that is:
Code: Pascal  [Select][+][-]
  1. program BirthdayParadox;
  2. {$mode objfpc}
  3. uses
  4.   sysutils,math;
  5.  
  6. function CalculatePeopleForProbability(p: Double): Integer;
  7. begin
  8.   // Approximate the number of people needed for a given probability
  9.   Result := Ceil(Sqrt(2 * 365 * Ln(1 / (1 - p))));
  10. end;
  11.  
  12. begin
  13.   // Calculate the number of people needed for a 50% probability
  14.   // that two people share the same birthday
  15.   WriteLn('Number of forum members needed for a 50% probability: ', CalculatePeopleForProbability(0.5));
  16.   writeln(DateTimeToStr(21237.0));
  17. end.
But I am sure they don't want the Trumps back...

paweld

  • Hero Member
  • *****
  • Posts: 1326
Re: 21237.0 as TDateTime
« Reply #1 on: February 21, 2024, 09:02:14 am »
@Thaddy: Happy birthday. Sto lat!
« Last Edit: February 21, 2024, 08:09:08 pm by paweld »
Best regards / Pozdrawiam
paweld

cdbc

  • Hero Member
  • *****
  • Posts: 1964
    • http://www.cdbc.dk
Re: 21237.0 as TDateTime
« Reply #2 on: February 21, 2024, 09:06:20 am »
Hi
A very happy birthday to you Thaddy  :)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

TRon

  • Hero Member
  • *****
  • Posts: 4153
Re: 21237.0 as TDateTime
« Reply #3 on: February 21, 2024, 07:40:05 pm »
Happy birthday Thaddy and enjoy !
Today is tomorrow's yesterday.

 

TinyPortal © 2005-2018