Tags » Random Walk

The Sunbury Dice Game: A Random Walk in the Sunbury Walled Garden

The Sunbury Dice Game
A Random Walk in the Sunbury Walled Garden

Published April 2015
ISBN 978-1-910578-10-0
A3 fold out map
Author – Alban Low and Harvey Wells… 363 more words

Small fish in a Big Pond

Alas, after almost three years, I find myself in the same black hole that I was trying to escape from. There it is again – the feeling of of the familiar, the feeling of being a small fish in a big pond. 457 more words

Travel

Markov Chain Monte Carlo Without all the Bullshit

I have a little secret: I don’t like the terminology, notation, and style of writing in statistics. I find it unnecessarily complicated. This shows up when trying to read about Markov Chain Monte Carlo methods. 2,726 more words

Mathematics

MIT 6.00SC | Lecture 13 | Some Basic Probability and Plotting Data

Introduction

In the last lecture, we had a error in our code, because the Random walk code, did not output correct value of small samples as we had manually checked. 1,006 more words

MIT OCW

MIT 6.00SC | Lecture 12 | Introduction to Simulation and Random Walks

Generator Yield

We will start with the example in the previous lecture, see the code here;-

import datetime

class Person(object):
def __init__(self, name):
#Create a person with name
self.name = name
try:
firstBlank = name.rindex(' ')
# print "__init__: firstBlank: ", firstBlank
self.lastName = name
except :
self.lastName = name
self.birthDay = None
def getLastName(self):
#returns self's last name
return self.lastName
def setBirthday(self,birthDate):
#assumes that self's birthday is of type datetime.date
#sets self's birthday to birthDate
assert type(birthDate) == datetime.date
self.birthDay = birthDate
def getAge(self):
#assumes that self's birthday is set
#returns self's age in days
assert self.birthDay != None
return (datetime.date.today() - self.birthDay).days
def __lt__(self,other):
#returns True if self name is lexicographically greater
#than other's name, and False Otherwise
if self.lastName == other.lastName:
return self.name < other.name
return self.lastName < other.lastName
def __str__(self):
return self.name

class MITPerson(Person):
nextIDNum = 0
def __init__(self, name):
#super(MITPerson, self).__init__()
Person.__init__(self,name)
self.idNum = MITPerson.nextIDNum
MITPerson.nextIDNum += 1
def getIdNum(self):
return self.idNum
def __lt__(self, other):
return self.idNum < other.idNum
def isStudent(self):
return type(self)==UG or type(self)==G

class UG(MITPerson):
def __init__(self, name):
MITPerson.__init__(self, name)
self.year = None
def setYear(self, year):
if year > 5:
raise OverflowError('Too many')
self.year = year
def getYear(self):
return self.year

class G(MITPerson):
pass

class CourseList(object):
def __init__(self, number):
self.number = number
self.students = []
def addStudent(self, who):
if not who.isStudent():
raise TypeError('Not a student')
if who in self.students:
raise ValueError('Duplicate student')
self.students.append(who)
def remStudent(self, who):
try:
self.students.remove(who)
except:
print str(who) + ' not in ' + self.number
def allStudents(self):
for s in self.students:
yield s
def ugs(self):
indx = 0
while indx < len(self.students):
if type(self.students) == UG:
yield self.students
indx += 1
… 1,494 more words
MIT OCW

Term of the day: Random walk

In economics the “random walk” refers to the fact that the stock market price can not be predicted, because the historical movement of a stock price is not consistent with the future movement. 111 more words

Economics

An Entanglement with a great mind: Prof. V. Balakrishnan

–Dinesh K. Pinto

It’s been exactly two weeks since Prof V. Balakrishnan, or, as he’s more popularly known in physics circles; ‘the guy wrote the foreword to the Feynman lectures’ returned to St. 967 more words

The Perspective