Yeah I'm sure a Pi can do it. It can be a wol device too.
yikes... I'd probably look into a new case, as things should be super toasty in there..
So I cleaned my keyboard yesterday and now I want another one
from random import randint
def door(switch = True, p = False):
def eliminate(doors, win, guess):
for item in [guess, win]:
if item in doors:
doors.remove(item)
r = randint(0, len(doors)-1)
eliminated = doors.pop(r)
for item in [guess, win]:
if item not in doors:
doors.append(item)
doors.sort()
return doors
doors = [1, 2, 3]
win = randint(1, 3)
guess = randint(1, 3)
doors = eliminate(doors, win, guess)
if switch:
doors.remove(guess)
guess = doors[0]
if guess == win:
return 1
else:
return 0
def doors(switch = True, n = 10000):
wins = 0
for i in range(0, n):
wins += door(switch)
return '%d:%d' % (wins, n-wins)
So I cleaned my keyboard yesterday and now I want another one; a K70 RGB to be exact. The only issue with that is the RGB flavor is no longer available with Blues, which leaves me with having to get them with Browns...
Oh that isn't the issue at all because I've yet to pick up a keyboard with Brown switches. The issue is I'll still want a full-sized keyboard with Blue switches (I have my Mid 87 but the fact I still haven't picked up an wrist rest for it means I haven't given it much love) and that'll leave me eyeing a Das 4 Ultimate (blank keycaps).
I'll get both no questions asked, I just... I need help.
So I cleaned my keyboard yesterday and now I want another one; a K70 RGB to be exact. The only issue with that is the RGB flavor is no longer available with Blues, which leaves me with having to get them with Browns...
Oh that isn't the issue at all because I've yet to pick up a keyboard with Brown switches. The issue is I'll still want a full-sized keyboard with Blue switches (I have my Mid 87 but the fact I still haven't picked up an wrist rest for it means I haven't given it much love) and that'll leave me eyeing a Das 4 Ultimate (blank keycaps).
I'll get both no questions asked, I just... I need help.
I decided to test the Monty Hall problem:
import random
def door(switch = True, nd = 3):
def choose(doors, exclude):
cdoors = []
# add non-excluded doors
for x in doors:
if x not in exclude:
cdoors.append(x)
# randomly choose between remaining doors
return random.choice(cdoors)
def eliminate(doors, exclude):
e = choose(doors,exclude)
doors.remove(e)
return doors
# setup instance
doors = list(range(1, nd+1))
win = random.randint(1, nd)
guess = random.randint(1, nd)
# montys move
doors = eliminate(doors, [win, guess])
# our move
if switch:
guess = choose(doors, [guess])
# let's see if we won
if guess == win:
return 1
else:
return 0
def doors(switch = True, nd = 3, n = 10000):
wins = 0
for i in range(0, n):
wins += door(switch,nd)
return '%d:%d' % (wins, n-wins)
print ("3 doors, switch", doors(True))
print ("3 doors, keep ", doors(False))
print ("4 doors, switch", doors(True,4))
print ("4 doors, keep ", doors(False,4))
print ("5 doors, switch", doors(True,5))
print ("5 doors, keep ", doors(False,5))