Skip to content

Instantly share code, notes, and snippets.

View ztane's full-sized avatar

Antti Haapala ztane

View GitHub Profile
@ztane
ztane / millionaire5050.py
Created February 27, 2016 16:58
50/50 simulation of WWTBAM
% python3 millionaire.py
Out of 1000000 cases
Initial was eliminated in 499869 cases (49.9869 %)
Initial was not eliminated in 500131 cases (50.0131 %)
There answer was different from initial in 249818 cases
Thus changing is winning 49.95051296560301 % if initial was not eliminated
<?php
#Equivalent to this PHP codes:
$gmt_timezone = new DateTimeZone('GMT');
$obj_date = new DateTime(null,$gmt_timezone);
echo $obj_date->format('d/m/Y h:i:s');
#OR
date_default_timezone_set("GMT");
echo date('d/m/Y h:i:s', time());
?>