text:
## Lecturer position in Statistics at Dauphine

21/10/2016

An associate professor (“Maître de conférences”) position in Applied or Computational Statistics is expected to be open at Université Paris-Dauphine. The recruitment process will mostly take place during the spring, for an appointment date of 1 September 2017.

However, candidates must first go through the national “qualification”. This process should not be problematic, but is held much earlier in the year: you need to sign up by 25 October (next week!), then send some documents by December. Unfortunately, the committee cannot consider applications from candidates who do not hold the “qualification”.

If you need help with the process, feel free to contact me.

## David Cox is the inaugural recipient of the International Prize in Statistics

20/10/2016

David Cox was announced today as the inaugural recipient of the International Prize in Statistics.

My first foray into Statistics was an analysis of Cox models I did for my undegraduate thesis at ENS in 2005. I had no idea back then that David Cox was still alive and active; in my mind, he was a historical figure, on par with other great mathematicians who gave their names to objects of study — Euler, Galois, Lebesgue…

When I arrived at Oxford a few months later, I was amazed to meet him, and to see that he was still very active, both as a researcher and as the organizer of events for doctoral students.

David Cox is the perfect choice as the first person to receive this prize. I hope that the inauguration of this prize will help show the public that Statistics require complex and innovative methods, that have been tackled by some exceptional minds, and should not be seen as a “sub-science” compared to other more “noble” sciences.

## MCMSki 4

06/01/2014

I am attending the MCMSki 4 conference for the next 3 days; I guess I’ll see many of you there!

I am organizing a session on Wednesday morning on Advances in Monte Carlo motivated by applications; I’m looking forward to hearing the talks of Alexis Muir-Watt, Simon Barthelmé, Lawrence Murray and Rémi Bardenet during that session, as well as the rest of the very strong programme.

I’ll also be part of the jury for the best poster prize; there are many promising abstracts.

## Corcoran medal

17/10/2013

Two weeks ago, I had the great honour of receiving the 2012 Corcoran memorial medal and prize for my doctoral dissertation. It is awarded by Oxford’s Department of Statistics in memory of Stephen Corcoran, a student who died in 1996 before having time to complete his DPhil. Being a Statistics prize, there is smoothing in the award process: it is awarded every two years, to a DPhil which was completed in the last four years (i.e. between October 2008 and October 2012 in my case). The ceremony was part of the Department’s 25th anniversary celebrations.

Nils Lid Hjort gave a lecture on his “confidence distributions”, a way to represent uncertainty in the non-Bayesian framework. Although he gave examples where his representation seems to work best, I wondered how this could extend to cases where the parameter is not unidimensional.

Chris Yau received the 2010 Corcoran prize and gave a short talk on applications of HMMs togenetic data; he was unlucky to have his 15-minute talk interrupted by a fire alarm (but that allowed me to wonder at how calmly efficient the British are at evacuating in such situations). Luckily, my own talk suffered no such interruption.

Peter Donnelly demonstrated once again his amazing lecturing skills, with a highly informative talk on statistical inference of the history of the UK using genetic data.

All in all, a very enjoyable afternoon, which was followed by a lovely dinner at Somerville College, with several speeches on the past, present and future of Statistics at Oxford.

Thanks again to the Corcoran committe, especially Steffen Lauritzen, for selecting me as the prize winner!

## Expect some blog posts in French

24/06/2013

This is just a warning that from now on, a small proportion of my blog posts will be in French. I’ll use French for posts which I think will appear primarily to French speakers: either posts for students of courses that I give in French, or posts on the French higher educational system which would be of little interest to people outside of France. I guess this is similar to what Arthur Charpentier does.

In particular, I’ll keep posting in English for anything related to my research topics.

## PhD acknowledgement

18/04/2013

Acknowledgement from an anonymous doctoral dissertation in the University Microforms International database:

If I had a dime for every time my wife threatened to divorce me during the past three years, I would be wealthy and not have to take a postdoctoral position which will only make me a little less poor and will keep me away from home and in the lab even more than graduate school and all because my committee read this manuscript and said that the only alternative to signing the approval to this dissertation was to give me a job mowing the grass on campus but the Physical Plant would not hire me on account of they said I was over-educated and needed to improve my dexterity skills like picking my nose while driving a tractor-mower over poor defenseless squirrels that were eating the nuts they stole from the medical students’ lunches on Tuesday afternoon following the Biochemistry quiz which they all did not pass and blamed on me because they said a tutor was supposed to come with a 30-day money-back guarantee and I am supposed to thank someone for all this?!!

(From a UMI press release, quoted in The Whole Library Handbook 2, 1995)

Source: Futility Closet via Arthur Charpentier.

## Unicode in LaTeX

16/04/2013

The way I type LaTeX has changed significantly in the past couple of months. I now type most of my math formulae in unicode, which makes the source code much more readable.

A few months ago, I might have written

$\lambda/\mu=\kappa/\nu \Rightarrow \exists \Theta,\forall i, \sum_{j\in\mathbb{N}} E[D_{i,j}]=\Theta$

to display

$\lambda/\mu=\kappa/\nu \Rightarrow \exists \Theta,\forall i, \sum_{j\in\mathbb{N}} E[D_{i,j}]=\Theta$.

Now, to type the same equation, my LaTeX source code looks like this:

$λ/μ=κ/ν ⇒ ∃Θ,∀i, ∑_{j∈ℕ} E[D_{i,j}]=Θ$

which produces exactly the same output. The source code is much easier to read; it is also slightly easier to type. Here is how the magic works:

\usepackage[utf8x]{inputenc}
\usepackage{amssymb}
• A number of special characters (including all Greek letters) were already easily available to me because I use a bépo keyboard (if you are a French speaker, you should try it out); otherwise, all characters are available using any keyboard to users of a Unix-like OS thanks to this great .XCompose file. For example, to get ℕ, use the keys Compose+|+N (pretty intuitive, and faster than typing \mathbb{N}). To get ∃, use Compose+E+E; to get ∈, use Compose+i+n, and so on.
• There are two issues with this solution: first, the unicode symbol α maps to \textalpha instead of \alpha; second, the blackboard letters map to \mathbbm instead of \mathbb. This can lead to errors, but I wrote this file which solves the issue by including in the preamble:
\input{greektex.tex}

This is useful for LaTeX, but also for all other places where you might want to type math: thanks to this .XCompose file, typing math in a blog post, tweet or e-mail becomes easy (for example, this is the last blog post where I will use WordPress’ \$latex syntax). And if there ever is a LaTeX formula that you cannot access from your keyboard, you can use a website such as unicodeit.net which converts LaTeX source code to unicode.

## Late homework

11/04/2013

My Bayesian Case Studies students had to hand in their final report last week; as I expected, some handed it in after the deadline.

I know several colleagues whose official position is that if the report is handed in late, the student fails the course. This is fine if the report is very late, but it seems a bit drastic for a small delay (e.g. a few minutes!). The problem of course is to define very and small in the previous sentence. And even if you decide that the course is failed for students who are more than (say) 24 hours late, it seems a bit unfair to have such a big difference between being 23 hours 59 minutes late and 24 hours 1 minute…

This time, I am using a continuous decreasing function as penalty: I told the students that

“Your report should be sent by e-mail by 2 April 2013 at noon. In case of a late submission, your grade will be multiplied by exp(-0.001 ⋅ t³ /86400³ ) where t is the number of seconds between the deadline and your submission.”

This basically means that they can be 2 days late for free. If a student has a legitimate reason for being late, they will usually manage to fit in that window, so they do not need to explain their lateness. Being 4 days late knocks off 6% of the grade; being a week late knocks off 30%. A student more than 8.8 days late loses 50% of their grade, meaning the course is necessarily failed, even if the report is perfect.

In this case, the last student to hand in his work was about 3.5 days late, meaning the mark will be multiplied by 0.953.

I quite like this system, although I think it was a bit too generous with this exact implementation. I cannot claim to have invented it; I read about it somewhere else, with a different penalty function, but cannot find where.

Edit: Thanks to Mahendra for the original post: here, on the Messy Matters blog.

## MCMSki 4 session accepted

11/04/2013

I juste received news from the organizers of MCMSki 4 that my proposed session on “Advances in Monte Carlo motivated by applications” has been accepted; it will be the first session I chair at a conference.

Three young and talented speakers have accepted to take part in this session, and I am looking forward to hearing what they have to say:

Alexis Muir-Watt will talk about PMCMC advances for the doubly-intractable problem of estimating a partial order, with application to the social order between 12th century bishops.

Lawrence Murray will also discuss PMCMC, for applications in the environmental sciences including marine biogeochemistry, soil carbon modelling and hurricane tracking.

Simon Barthelmé will discuss using quasi-Kronecker matrices to speed up MCMC for functional ANOVA problems, with an application in neurosciences.

All these speakers have been dealing with challenging data sets and models. These applications have led to methodological advances, and the session will at the same time showcase the variety of applications and the way they help BayesComp methodology progress.

MCMSki 4 will be held in Chamonix, January 6-8 2014.

## Visiting UCLA

28/02/2013

I shall be spending next week (4th-9th March) at the UCLA Department of Linguistics, where I shall give five hours of talks on Statistics for Historical Linguistics: a two-hour review of the field (Thursday morning), a two-hour presentation of my own DPhil work (pdf) (Friday afternoon), and a one-hour tutorial on TraitLab (Friday afternoon?). Abstracts:

1. Statistical methods in Historical Linguistics (Thursday morning)
Recent advances in our understanding of language change, in statistical methodology, and in computational power, along with an increasing wealth of available data, have allowed significant progress in statistical modelling of language change, and quantitative methods are gaining traction in Historical Linguistics. Models have been developed for the change through time of vocabulary, morpho-syntactic and phonetic traits. I shall present a review of these models (from a statistician’s point of view), starting with Morris Swadesh’s failed attempts at glottochronology, then looking at some models developed in the last decade. In parallel, I shall provide brief insights into statistical tools such as Bayesian statistics and Markov Chain Monte Carlo, in order to show how to use these effectively for linguistic applications.
2. A phylogenetic model of language diversification (Friday afternoon)
Language diversification is a random process similar in many ways to biological evolution. We model the diversification of so-called “core” lexical data by a stochastic process on a phylogenetic tree. We initially focus on the Indo-European language family. The age of the most recent common ancestor of these languages is of particular interest and issues of dating ancient languages have been subject to controversy. We use Markov Chain Monte Carlo to estimate the tree topology, internal node ages and model parameters. Our model includes several aspects specific to language diversification, such as rate heterogeneity and the data registration process, and we show that lexical borrowing does not bias our estimates. We show the robustness of our model through extensive validation and analyse two independent data sets to estimates the age of Proto-Indo-European. We then analyse a data set of Semitic languages, and show an extension of our model to explore whether languages evolve in “punctuational bursts”. Finally, we revisit an analysis of several small data sets by Bergsland & Vogt (1962).
Joint work with Geoff Nicholls

3. Tutorial and practical: TraitLab, a package for phylogenies of linguistic and cultural traits
In this tutorial, I shall present how to use the TraitLab package, which was initially developed specifically for the modelling of core vocabulary change through time, and guide interested attendants through an analysis of a simple data set. TraitLab is a software package for simulating, fitting and analysing tree-like binary data under a stochastic Dollo model of evolution. It handles “catastrophic” rate heterogeneity and missing data. The core of the package is a Markov chain Monte Carlo (MCMC) sampling algorithm that enables the user to sample from the Bayesian joint posterior distributions for tree topologies, clade and root ages, and the trait loss and catastrophe rates for a given data set. Data can be simulated according to the fitted Dollo model or according to a number of generalized models that allow for borrowing (horizontal transfer) of traits, heterogeneity in the trait loss rate and biases in the data collection  process. Both the raw data and the output of MCMC runs can be inspected using a number of useful graphical and analytical tools  provided within the package. TraitLab is freely available and runs within the Matlab computing environment.

Attendants who wish to use TraitLab during the practical should have a computer with Matlab installed.

TraitLab was developed jointly with Geoff Nicholls and David Welch.


text:
# Programming Challenge 1

This topic is 3772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Optimize the following code and give detailed reason.
// Initialize iloveseven to an array of 7s
int i, j;
int iloveseven[1024][1024];

for(i = 0; i < 1024; i++) for(j = 0; j < 1024; j++) iloveseven[j][i] = 7;

Hints: obviously the code has no logical problem. Try to think in a remote area of computer programming. EDIT: more hints: paging, int has size of 4 bytes EDIT2: Check answer on page 2 of this thread [Edited by - TimChan on August 15, 2007 8:43:17 PM]

##### Share on other sites
You could pre-increment for a start :P. Though the compiler most likely sorts that out.

##### Share on other sites
Quote:
 Original post by DaveYou could pre-increment for a start :P. Though the compiler most likely sorts that out.

##### Share on other sites
Optimize for what — space? Performance?

First thought (probably not what you're looking for, though; technically, I guess it also doesn't function in exactly the same way in that it isn't possible to overflow):

template <typename T> class FilledContainer{    T fill;public:    FilledContainer(T Fill) : fill(Fill)    {}    T operator[](unsigned long)    {        return fill;    }};// ...FilledContainer<int> foo(7);

##### Share on other sites
iloveseven[i][j] has better cache coherency, since i changes less frequently than j.

TheUnbeliever: That's cute, I like that.

##### Share on other sites
cant you just memset that entire block of memory?

##### Share on other sites
Can you go from i = 0 to i = 1048576 and hop through *iloveseven setting each to 7?

or just iloveseven[1024][1024] = {7}; //can't remember if that works how I'm thinking it does

##### Share on other sites
// Initialize iloveseven to an array of 7sshort i, j;char iLoveseven[1024][1024];for(i = -1; i < 1024; ++i) for(j = -1; j < 1024; ++j) iLoveseven[i][j] = 7;

##### Share on other sites
You are misusing the cache.
Try this:
for(j = 0; j < 1024; j++) for(i = 0; i < 1024; i++) iloveseven[j][i] = 7;

##### Share on other sites
Quote:
 Original post by jpetrieiloveseven[i][j] has better cache coherency, since i changes less frequently than j.TheUnbeliever: That's cute, I like that.

So what exactly cache coherency means? Your answer is correct and expected but I think the explanation is incomplete.

##### Share on other sites
Quote:
 Original post by InsaneBoarder234 *** Source Snippet Removed ***

for(i = -1; i < 1024; ++i) for(j = -1; j < 1024; ++j) iLoveseven[i][j] = 7;

Except that means that you die painfully immediately when you try to access iLoveseven[-1][-1]

##### Share on other sites
Obviously, more constraints on what you're allowed to do to the code to optimize it would have been helpful. Converting iloveseven[1024][1024] into [1024*1024] and using one loop would have been my choice -- solves the cache coherency issue, and I like 1D arrays better anyway (but that array dimension isn't a concern here).

These sorts of things are 99% of the time obnoxious micro-optimizations. Profile, profile, profile.

Quote:
 cant you just memset that entire block of memory?

You'd want to use fill_n or similar, not memset, but yes, that also achieves the solution of improving cache coherency.

Quote:
 or just iloveseven[1024][1024] = {7}; //can't remember if that works how I'm thinking it does

If there are few initializer clauses in an initializer list than there are members in the aggregate, the remaining members are value-initialized (that is, zerod). It won't work here, but if you wanted to zero-initialize the array it would.

Quote:
 So what exactly cache coherency means?

It means you're performing the access in a coherent fashion, in this case linearly stepping across the entire region of memory instead of jumping about in 1024-element chunks. I appreciate that you're from Hong Kong, and English may not be your native language, but the term is generally fairly sufficiently understood. Would you like me to define cache, too?

##### Share on other sites
Quote:
 Original post by TimChanSo what exactly cache coherency means? Your answer is correct and expected but I think the explanation is incomplete.
You should know, you're apparently the one applying for the job and using jpetrie's answers to sleaze past the interview.

##### Share on other sites
you could also unroll the loop to reduce overhead

##### Share on other sites
Quote:
Original post by Ravuya
Quote:
 Original post by TimChanSo what exactly cache coherency means? Your answer is correct and expected but I think the explanation is incomplete.
You should know, you're apparently the one applying for the job and using jpetrie's answers to sleaze past the interview.

hehe

##### Share on other sites
Quote:
 Original post by TheUnbelieverExcept that means that you die painfully immediately when you try to access iLoveseven[-1][-1]

Eeee... I think I read a while ago that ++i incremented i before it was used by the for loop and I just took it as that, it seems I was wrong though!

##### Share on other sites
Quote:
 Original post by jpetrieiloveseven[i][j] has better cache coherency, since i changes less frequently than j.TheUnbeliever: That's cute, I like that.

It took me a couple of looks at iloveseven[i][j] and iloveseven[j][i] to even realize you changed something. Just saw the iloveseven[?][?] and assumed iloveseven[i][j]. *hits self for being stupid and not paying attention*

##### Share on other sites
Quote:
Original post by Ravuya
Quote:
 Original post by TimChanSo what exactly cache coherency means? Your answer is correct and expected but I think the explanation is incomplete.
You should know, you're apparently the one applying for the job and using jpetrie's answers to sleaze past the interview.

LOL Of course no, I'm already a paid web programmer. And I don't think such question would appear in job interview since it is about low-level stuff or OSDev...

##### Share on other sites
Quote:
 Eeee... I think I read a while ago that ++i incremented i before it was used by the for loop and I just took it as that, it seems I was wrong though!

++i behaves the way you think, that's not the problem. The problem is that the loop executes the body first before the increment statement is executed. You can still preincrement the iteration index, you just still want to have the index initialized to 0 to begin with so you don't execute the bodies with i and j equal to -1.

##### Share on other sites
Ah ok I understand. Ah well, ta for clearing that up :)

##### Share on other sites
Quote:
Original post by jpetrie
Quote:
 cant you just memset that entire block of memory?

You'd want to use fill_n or similar, not memset, but yes, that also achieves the solution of improving cache coherency.

Indeed. Optimized for style:

const int size = 1024;// Initialize iloveseven to an array of 7sint iloveseven[size][size];std::fill_n(iloveseven, size * size, 7);

##### Share on other sites
iloveseven.cpp :

int iloveseven[1024][1024] =
{
{ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, ..., 7, 7, }
{ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, ..., 7, 7, }
{ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, ..., 7, 7, }
....
{ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, ..., 7, 7, }
};

fin.

GENiloveseven.cpp :

// generate iloveseven.cpp
...

fin.

This is a fast iloveseven filling no ? May we consider that the asm code generate from iloveseven.cpp fill a 1024*1024 memory array fastly ?

##### Share on other sites
Quote:
Original post by Zahlman
Quote:
Original post by jpetrie
Quote:
 cant you just memset that entire block of memory?

You'd want to use fill_n or similar, not memset, but yes, that also achieves the solution of improving cache coherency.

Indeed. Optimized for style:

const int size = 1024;// Initialize iloveseven to an array of 7sint iloveseven[size][size];std::fill_n(iloveseven, size * size, 7);

I don't know, but fill_n could actually have been implemented as a loop (I suspect they use different strategies for different cases).
And then there are the optimizations done by the compiler. Relative small arrays may get inlined like:

array[0] = 7;
array[1] = 7;
array[2] = 7;

instead of a loop.

##### Share on other sites
Quote:
 Relative small arrays may get inlined like:

Perhaps, but why worry?

Optimizing for what you think the compiler will generate in terms of machine code is fruitless. Unrolling the loop may or may not be done by the compiler, so it shouldn't be considered a reasonable "optimization" to attempt to the C++ code.

The only real sane optimization you can make is the observation that the algorithm in question suffers from poor locality (it doesn't traverse the storage linearly). Worrying about unrolling the loop or other things where you try to cajole the compiler into generating better assembly is problematic because they're not general-purpose solutions, whereas improving the algorithm is.

Besides, it's also worth nothing that if the array is small enough to be trivially manually inlined, it's probably small enough that the cache coherency issue isn't relevant. That applies mainly to large datasets.

##### Share on other sites
Quote:
Original post by jpetrie
Quote:
 Relative small arrays may get inlined like:

Perhaps, but why worry?

I don't. Not in real life, at least.

It's a challenge, I have no idea how sane the solutions have to be. Nor do I know if it should be optimized for size or for speed (I suspect the latter), or whether the optimizations are allowed to be limited to a single platform. I merely indicating that the gains in performance (if taken to the extreme) can be different from what could be expected by reading the code.

##### Share on other sites

This topic is 3772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• ### Forum Statistics

• Total Topics
628682
• Total Posts
2984213

• 11
• 13
• 13
• 9
• 10

format: plain


text:
Reddit Feeds

214
Posted by7 years ago
Archived

## What intrigues me isn't the fact that this guy won the lottery twice, but that the Missouri Lottery official thinks it's impossible to calculate the odds. This simple ignorance is sad.

89% Upvoted
Sort by
best
109 points·7 years ago

It's like the square root of a million: no one will ever know.

106 points·7 years ago

No, it's easy! He either wins or he doesn't, so it's 50-50! :)

47 points·7 years ago

Yeah, but he either won or didn't win twice! That's why it's so complicated.

[deleted]
71 points·7 years ago

100-100. Easy!

1 point·7 years ago

That just means that his chances of winning doubled (50% + 50% = 100%), thusly making his winning an absolute certainty.

We can see this is true in the fact that he clearly did win. QED

28 points·7 years ago

Having taught undergraduate statistics before, I will say that this statement is nearly irrefutable to a majority of psychology majors.

22 points·7 years ago

Being an undergraduate currently taking statistics, I will say that I do not know what the word "irrefutable" means.

[deleted]
4 points·7 years ago

failure to reject the null hypothesis with an alpha < .05, of course.

-1 points·7 years ago

I literally lol'd

18 points·7 years ago

I statistically lol'd.

-1 points·7 years ago

llol'd?

3 points·7 years ago

the internet doesn't approve of your new abbreviation :(

0 points·7 years ago

This type of logic is one of the many reasons i hate The Terminal (the Tom Hanks movie)

0 points·7 years ago

1000?

54 points·7 years ago

Don't act so smug, please. Not everyone is as good as you.

22 points·7 years ago

Elitist.

[deleted]
7 points·7 years ago

You are the ruiner of jokes.

4 points·7 years ago

It's actual 103 you smug butt.

4 points·7 years ago

Heyyyy it was not my intention! I didn't know it was a joke

54 points·7 years ago

It's still not quite straightforward. First we have to define the event. What are we talking about here? Winning a big-pot lottery twice in a lifetime, given that you buy one ticket every week? Two tickets? One ticket for every lottery in your area? It's probably not so obvious what the terms are.

Original Poster47 points·7 years ago

Yes, agreed. But to say it's impossible to calculate is just ignorant, especially after stating the specific odds on each one.

83 points·7 years ago

It's also true that reporters frequently misquote people.

He may have said "Well that's hard to say, they are both different games... First of all you have to define the question that you are asking"

[scribble scribble ] Thank-you sir that's all I need.

15 points·7 years ago

it was probably even worse.

reporter: so would you say the odds are 1 in a quantillion of winning both ?

a: no you can't calculate like that, given that he has already won a single drawing, the second one is independent ... if anything the fact that he has won means that he is one of the group of people who buy lottery cards ...

reporter: got it! impossible

11 points·7 years ago

After winning one lottery, he has a track record of picking good numbers. So surely, he has a higher probability of winning a second lottery.

10 points·7 years ago

Omg the downvotes, really? This is clearly a joke.

8 points·7 years ago

I agree, most reporters just want the story to sound good. Correctness is not a necessity.

24 points·7 years ago

Obligatory : Probability of the two independent events - 1 in 5.1984 trillion.

[deleted]
16 points·7 years ago

That's the chance of him winning twice, but that is different from the chance of anyone winning twice.

11 points·7 years ago

This sure seems to be commonly overlooked. It is easy to calculate odds exactly, the trick is to choose the most meaningful class of events to calculate odds for. There is no single best way to do this, but just calculating the odds of a given particular person playing each lottery just once and winning both times is about as meaningless as it gets. If it is a US lottery, the chances of, say, a "double million dollar winner" type thing happening in a given year are (to within an order of magnitude) = (# of million dollar prizes in US that year)2/(# of people playing some lottery that year) which with some (very gross) estimates would be something like (500)*(500)/(100,000,000), or 1 in 400. So improbable, but not all that amazing.

2 points·7 years ago

I'm confused by your analysis. Are you saying that there is a 1/400 x "the odds of winning the lottery" chance of winning it twice?

7 points·7 years ago·edited 7 years ago

No, I'm saying that it is 1/400 straight up that it happens in a given year to somebody. No matter who it happened to, it would still be in the news. That is still pretty amazing in a way, that something like this should only happen on average every 400 years. In general I would say the key is the difference between a subjective perspective where "hey I won the lottery!" is an amazing and improbable thing, versus an objective perspective where "hey look a guy won the lottery" is completely unamazing because, hey, somebody was going to win.

Edit: "the something" -> "that something"

[deleted]
3 points·7 years ago·edited 7 years ago

It's the birthday problem. If you're in a room full of people, what are the odds that someone will have the same birthday as you? Roughly n/365 (n being the number of people in the room). Now given a room full of n people, what are the odds that some two people will have the same birthday?

n!(365 choose n)/365n

365 choose n is just the total number of combinations of n days out of 365. So actually for 23 people it works out to 50%. For 57 people it's 99%. So for a much smaller group than you'd expect you almost definitely have two people with the same birthday. Anyway... I think that's what Animetoca was getting at.

2 points·7 years ago·edited 7 years ago

Yes, the problems are isomorphic. Instead of randomly assigning lotteries winners to various lotteries one assigns birthdays to various people-in-the-room. The math (which I just approximated) is the same either way. I do believe though that the formula you gave is actually the probability that all the birthdays are unique, so the probability of at least two people sharing a birthday is 1 - (n! etc).

Anyway, the birthday problem is a great starting point for what I was getting at, which was more about why the odds are higher than we might guess at first and how the same reasoning applies in many other cases.

[deleted]
2 points·7 years ago

Ah yes. Good catch. I got 3 hours of sleep last night so I was kind of running on empty this morning.

1 point·7 years ago

Ah, thanks for the further explanation, guys. I over-thought it and somehow looped around to under-thinking the problem.

[deleted]
11 points·7 years ago·edited 7 years ago

This is the kind of math that brought the housing market down.

"Probability of Dow dropping 500 points in a single day... 1 in 100 years... thus the probability of it dropping 500 points twice... 1 in 10000 years. Nothing to worry about folks."

Applying a probability to a question without fully understanding the question is a recipe for disaster.

Simply put... what happened to this guy is not a 1 in 5.2 trillion occurrence. The fact that a simple calculation is stating that it's a 1 in a 5.2 trillion occurrence should be an indication to stop, reflect on whether you truly understand the question, all the information available, and reconsider the simple math being employed to come to this conclusion.

Little else is more disastrous than the human mind's ability to over/under estimate rare events.

21 points·7 years ago

Well but the Dow example is a case where they aren't independent events. One occurring will impact the chance of it happening again. Not so with the lottery. The lottery is like rolling a 2.28-million(in this case) sided die, one roll does not affect subsequent rolls. You are correct though that the 1 in 5.1984 trillion is inflated; that would be the chance for winning twice with only two attempts

[deleted]
-2 points·7 years ago·edited 7 years ago

Well on the Dow example... check out the efficient market hypothesis which argues that they are in fact independent events.

Of course only strict academics believe in the EMH, but that's kind of the point I'm making. When you make a whole bunch of assumptions about what a question is asking, you can create your own model to answer it... however, that model may not in any way reflect reality.

In this case, we have a fairly ambiguous question being asked, and some people are jumping to a very precise answer to this ambiguous question. I think that's dangerous and as mathematicians, if the goal is to provide some kind of practical answer to a question as opposed to working in a very pure field... then it's disingenuous to just say the answer to this question is 1 in 5 trillion. The correct thing to do is to seek clarification, or maybe point out that the question itself is not well formed and needs to be simplified. Saying it's impossible isn't the best answer to give, but it's certainly better than saying 1 in 5 trillion.

In the book Black Swan by Nassim Taleb he writes that if you flip a coin 99 times and it comes up heads on each flip, if you ask a mathematician what the probability of it coming up heads on the 100th toss is, he'll say it's 50/50. If you ask a taxi driver, he'll say it's almost surely going to come up heads again.

In a strict mathematical world where one is free to make assumptions, the mathematician will be right. In the real world, it will be the taxi driver. One type of thinking results in catastrophic market failures every 10 years or so... failures which are supposed to only occur 1 in 10000 years according to mathematical models... I'll leave it to you guess which one that is.

10 points·7 years ago

if you flip a coin 99 times and it comes up heads on each flip, if you ask a mathematician what the probability of it coming up heads on the 100th toss is, he'll

begin to seriously doubt the fairness of the coin.

FTFY

[deleted]
1 point·7 years ago

love it

[deleted]
3 points·7 years ago

Let T be a taxi driver... never mind.

3 points·7 years ago

Oh man, just look at the bogus ultra-low p-values that some scientific papers try to report. I get the feeling people are just too lazy to figure out what the underlying assumptions behind these numbers are and assume that they're right since they are quantitative values.

[deleted]
5 points·7 years ago

Yes... but in this case we have two independent events P(X) and P(Y), P(X and Y) = P(X)*P(Y). Assuming we do know the precise probabilities of the two events ofcourse :)

1 point·7 years ago

That is the probability of two particular tickets being winning tickets. He has had many more than two tickets – all the rest have been failed attempts at a victory. He has had many chances to win, and you are ignoring all but two. Your statement does not reflect reality, and is, as such, useless.

If I flip 4 coins, what’s the probability that I will get heads twice (and only twice)? It’s not 1/4.

2 points·7 years ago

HHHH HHHT HHTH HHTT

HTHH HTHT HTTH HTTT

THHH THHT THTH THTT

TTHH TTHT TTTH TTTT

1 point·7 years ago

But that still doesn't tell the whole story. You actually have an indeterminate number of events not reported in the article. This drastically changes the true probability.

1 point·7 years ago

Even if he buys 1 ticket every lottery this is still the probabilities of winning the two events. Every time you roll the dice your probability of success is the same at the start of the roll, regardless of winning or losing the previous roll. In this case he probably lost many times before winning because the odds are so low. What would change the probability of winning is if he was buying more than one ticket at a time.

What you are doing is falling into the trap the reported did, start thinking about combining all the different lottery's and tickets over many years, and it seams impossible to calculate. But its missing that we have two winning events, and they have probabilities of winning independent of the previous events.

0 points·7 years ago

You're the one making the mistake: you're artificially ignoring data, to the point where the probability you're calculating has no relevance to anything interesting. Why should we ignore the thousands or more of lottery tickets that didn't win? How does independence explain why you're ignoring all these trials?

The interesting probability is winning the jackpot twice over all the games they played. In other words, the probability that someone else who buys the same number of tickets will win 2 jackpots in future lotteries. That is the true measure of how likely the feat mentioned in the article is.

[deleted]
0 points·7 years ago

If this were a high school question, on a test, then yes the correct answer to give is 1 in 5 trillion.

However, in actuality, let's consider first of all that lotteries have many intermediate prizes as well. If someone asks a question as vague as "What's the probability of winning any arrangement of lotteries twice?" what does that mean? Of winning any of the lottery's prizes? Only the biggest prize? Are each of the intermediate prizes also independent events? Is it factoring in multiple tickets being purchased over a long time period?

I agree that saying it's impossible to figure out isn't the best way of putting it... but it's much better than slapping a number like 1 in 5 trillion which is far more deceptive.

2 points·7 years ago

Downvoted for douchebaggery.

I agree that assuming two dependent events or independent is a recipe for disaster. But see, two things:

1. It's winning the lottery. Not even the same lottery, but two DIFFERENT lotteries. As independent as it gets. If you wanna whine about how it could have been rigged, sure go do that.

2. thecallmaster EXPLICITLY STATED that he was calculating the two independent events, and you bit his head off.

TBH, your post sounds like a douchebag liberal arts major that took "Survey of Statistics" and read an article on the housing crash, and now want to appear intelligent via intellectual snobbery.

[deleted]
1 point·7 years ago·edited 7 years ago

My major is in computer science, and I didn't read an article on the housing crash... I run a financial trading firm specializing in high frequency trading and pocketed more money during the crash than most people make in their entire life. Not only the stock market, but many aspects of life are just full of BS statistics based on simplistic assumptions, misunderstandings about what is being investigated, models that don't reflect reality, so on so forth... the fact that people think that the proper answer to this question is that this event is a 1 in 5 trillion occurrence simply goes to show how much about probability is misunderstood and how a lot about probability depends on the way in which the phenomenon is presented.

I stand by my argument that having a reporter ask a question as vague as "What's the probability of this guy winning the lottery twice?" simply has no meaningful answer. While thinking this event is so rare (1 in 5 trillion) has no major consequence and it's unlikely anyone will base any serious decision off of it... a lot of other simplistic probabilities do have catastrophic consequences.

But thanks for letting me know what my field of expertise is.

6 points·7 years ago

Specifically, the 1:5 trillion number is likely just plain wrong. The total number of tickets purchased is a significant variable in the equation. As I calculate elsewhere, if 1000 tickets are purchased, the probability is 1:100 million, and if the couple from the article purchase a roll of tickets each week, that probability keeps going up. It's not nearly as astronomical as people might think... because there were far more than the 2 trials everyone seems to be assuming.

I agree with you 100% and I wouldn't have the patience nor stomach to continue replying like you are. If your mathematical model is wrong, you're merely resorting to garbage-in-garbage-out. So kudos to you for attempting to educate a surprisingly math-illiterate r/math.

1 point·7 years ago

You're a lot more lucid about it than he is. I don't pretend I ever had a decent stats teacher or book but what you said is clearly irrefutable.

1 point·7 years ago

Really? O_o

I'll consider myself lucky then, cause I just thought I was reiterating what he was saying :P

Quick note, relating to the probability calculation, it's a bit of an oversimplification but it does show evidence of the qualitative nature of the problem.

1 point·7 years ago

I'm not sure what you mean by qualitative(apparently it was luck) but the question is clearly very much not well posed as it could mean many different things.

What I liked was how clear you were about the fact that the question doesn't explicitly necessarily state "What is the probably of him having won the lottery when he bought the first ticket and when he bought the second ticket in the quantity that he did?" which is my best way of saying the 1 in 5 trillion question.

Differential Geometry1 point·7 years ago

While I don't necessarily agree or disagree with any of the points you're making in this thread (I'm a mathematician, not a statistician), I will say that this particular post reads like the opposite of an ad hominem argument.

[deleted]
1 point·7 years ago

I'm sorry I'm not familiar with the opposite of an ad hominem argument.

Differential Geometry3 points·7 years ago·edited 7 years ago

Oh sorry, I should have said the opposite of an "ad hominem abuse" argument. It's almost like an appeal to authority, but the authority is based on some loosely-at-best-relevant fact.

Edit: I'm just messing around. Please don't try to suffocate me with all of your big piles of money.

[deleted]
2 points·7 years ago

I hear you... but I think it's appropriate if someone calls into question my background as being a liberal arts major (which I see nothing wrong with) whose only knowledge of the stock market is some blog post I read... it's fair for me to specify in three sentences that such is not the case and proceed with my main argument.

I also have no problem with appeals to authority so long as it's not used as a justification for an argument, but instead used to lend credibility. I respect expertise in a subject matter and when someone with a solid background/expertise says something I will be more inclined to believe it than if some random person says it.

0 points·7 years ago

Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2 instead?" Is it to your advantage to switch your choice?

Yes, yes indeed it is. The Monty Hall Problem

1 point·7 years ago

What is this a reply to? Why did you bring in the Monty Hall Problem?

1 point·7 years ago

Simple, it's a reply (or more of an insert) into a discussion about properly interpreting statistics. The MH problem is relevant in that context, if not to the situation at hand directly.

1 point·7 years ago

And that's all that's being asked for. No one wants a statistical analysis for 10-year long situations.

3 points·7 years ago

Sure, but HighJive's point is that you are missing a bunch of information. For instance, you need to know how many tickets he's buying, which you don't. You need to know how many tickets other people are buying, which you do, if you run the lottery.

1 point·7 years ago

You'd need to know that for a single-win too, but that didn't stop them from giving a figure for the single-win and yet saying a double-win is impossible to calculate.

In other words, the answer and question pairs are self-inconsistent.

1 point·7 years ago

If we have the odds on each one and they are independent shouldn't the theory hold? http://en.wikipedia.org/wiki/Independence_%28probability_theory%29#Independent_events

1 point·7 years ago

It seems pretty straightforward to me. The odds cited for one win are the odds that a particular ticket wins - so the odds of a double win should be that a particular pair of tickets wins on both.

3 points·7 years ago

Well, that's the thing. The probability usually cited for winning the lottery is generally just the probability that a particular ticket will be drawn in a particular draw. It's rather a natural way to define the probability of winning the lottery. However, if you square that number, you're really just, as you say, finding the probability that a particular pair of tickets both get drawn independently.

If this man only bought two tickets for the lottery in his life, that's a very interesting number. However, he's likely to have bought a lot more tickets in his life. So that raises the question whether perhaps this number is not very useful, and secondly, whether maybe the basic probability (that a particular ticket gets drawn) is in fact a bit useless to the general public.

[deleted]
2 points·7 years ago

Not to mention that we're talking about multiple games as well.

1 point·7 years ago

If the probabilities are equal(ish) (as the article says), I don’t believe it matters. Each drawing of a single game is independent – you can’t get any less dependent than that.

0 points·7 years ago

That's my point exactly, people shouldn't get their panties in a bunch over the two ticket case while they see no problem with the usual way of citing probabilities for one ticket.

4 points·7 years ago

But it could've been any two tickets. Presumably this individual buys a lot of lottery tickets. It was rather incidental that it was those specific two.

7 points·7 years ago

Yes, but then citing odds for any single ticket like they do doesn't make sense either. The only way to be consistent with that is to cite the odds of a pair (i.e. just multiply their odds since they are independent).

You can always roll yourself around in the possibility of unknown factors when talking about probabilities, but in this case there is only one sensible probability to talk about when you don't have any extra information.

[deleted]
4 points·7 years ago

Citing the odds for a single ticket is unambiguous. Citing the odds for any two possible lottery tickets at any point in someone's life... that is incredibly ambiguous and hence not subject to a well defined probability.

-1 points·7 years ago

Citing odds for a single ticket is equally ambiguous - it's just that everyone knows that you don't mean "one possible ticket at any point in someone's life."

2 points·7 years ago

Huh? Of course the odds for a single ticket is unambiguous. What on earth are you talking about?

[deleted]
8 points·7 years ago

I disagree. This is clearly about the odds that a man wins the lottery twice, not the odds that two particular tickets both win.

And we don't have enough information to know what the odds are that a man wins the lottery twice.

2 points·7 years ago·edited 7 years ago

Not sure what you disagree with. I'm saying that either

• since you accept that presenting odds for one particular ticket is "normal", the same should go for a particular pair, or

• you should be equally opposed to the way the odds are presented for one ticket.

And we don't have enough information to know what the odds are that a man wins the lottery twice.

Of course we don't. So we do the best abstraction we can. People can fill in the blanks if they have more information.

3 points·7 years ago

So we do the best abstraction we can.

Except it's not the best abstraction at all. 1000 tickets = 1:100 million chance, which is so much greater as to not even be significantly comparable to 2 tickets = 1:5 trillion chance.

If your mathematical model is flawed, it's garbage-in-garbage-out.

1 point·7 years ago

Except it's not the best abstraction at all.

That implies you have a better one, why don't you share it?

1 point·7 years ago

No it doesn't. It implies that sometimes "I don't know" is the best answer to a problem.

1 point·7 years ago

http://en.wikipedia.org/wiki/Memorylessness I don't think it matters how often he buys lottery tickets. The number of tickets bought at one time matters though. I may be mistaken??

2 points·7 years ago

It depends on what event we're discussing. If, indeed, we're discussing the event that his ticket was drawn for exactly these prizes in exactly these lotteries for these precise drawings, that's very easy and all that matters is his number of tickets for these two times. So in that case you'd be right.

However, the real event here isn't that he happened to win exactly these prizes, but that he won two big prizes in general -- a much broader event.

I guess the remark quoted is a bit strange though (and not one a good statistician would likely be heard saying).

1 point·7 years ago

but aren't they separate independent events and not one event and hence the probability theory could be used to calculate the odds of winning both (we are given the probability of the occurrence of each event)?

1 point·7 years ago

Yes, but then we have to ask ourselves if that combined event is really of interest. If he had won the first lottery, and then a completely different one from both of these -- or the same one as the second but only a week later -- wouldn't we basically looking at the same kind of event, but still one that falls outside of winning on these two defined drawings.

As you say, it's very easy to calculate this simple (combined) event, but the resulting number may not be of very much interest.

9 points·7 years ago

I think the proper way to look at the odds here is not "what are the odds of this guy winning twice" (because that's trivial), but "what are the odds of any one player winning twice"? I'm not sure how best to go about answering the second question, not least because you have to figure out how many different lotteries to consider in your calculations.

6 points·7 years ago

An even better question would be, "why is someone who won a million $lottery still buying scratch tickets?"... err, nevermind. 5 points·7 years ago Because his odds of winning a second time do not diminish after his first win. The odds of winning the first time? 1:2.28m The odds of winning the second time? 1:2.28m It's just like in roulette. If you bet on red, you will always have a 18:38 chance of winning, whether or not the last number was red. Now, the odds of winning both times, combined, is an entirely different story... 2 points·7 years ago·edited 7 years ago The qualitative answer to the second question (says I paraphrasing a math professor/teacher from many years ago, I really wish I remember how to calculate it myself) is "very large," significantly larger than the probability of a specific person from doing it. As t -> inf, this second probability approaches 1. Edit: come to think of it, if you make a bunch of simplifying assumptions, a "decent" approximation would be easily calculable. Of course none of us has the data... 12 points·7 years ago·edited 7 years ago Obviously, it is not impossible to calculate the odds, and in fact it is quite easy. The odds of k successes in N indepedent trials, each of which has a chance p of success and q := 1-p of failure, is given by (N!/((N-k)!k!))((pk)*qN-k) "!" means factorial. Wikipedia that if you don't know what it means. How many times he played is N. k=2. p according to the article is 1/2.28E6, which is about 4.39e-7, since the official said the odds of winning either prize are "about the same". The fact they are "different games" has nothing to do with anything except that it might change p, and it said they don't change. There you have it. This is assuming he was only playing one game at a time, and this is the calculation for exactly two wins on any two different days. If you want to find out the chance that he won at least two times, then you calculate this same thing but do it again for k=2, 3, ..., N, then add up all the results. It won't be much bigger than just k=2 (Can you see why?). Now if he were playing the two different games at the same time, then we would have to find the odds that he would win one or the other on any given day, and then use that as p, and do the same thing. That p would be (1/2.28E6)+(1/2.28E6)-(1/2.28E6)*(1/2.28E6), since the two games are independent, which is about 8.77E-7. This assumes that he played both games each time he played, and that might have won both on the same day. Now. If you are asking what the probability is he would win either on either day, and then either on some other day, and not both on on any day, then after an elementary proof which I will not show, you can perform the same calculation as above, but use 2pq instead of p, and 1-2pq in place of q. (note that 2pq cannot be greater than 1 since pq has a max of 1/2. Basic calculus will show you why...that bothered me for a second, whew). An elementary proof also shows that unless p=0 (meaning that he could never win the lottery), 2pq is actually always less than 2p - p2, which is the result of the last paragraph and makes sense. This or the last paragraph are probably what we were looking for when we asked what the odds of his situation occurring. Now, that wasn't so hard was it? Edit: corrected some small errors. 2 points·7 years ago It's just binomial that's all. 2 points·7 years ago It might be useful if you gave some example numbers for say n=1000 2 points·7 years ago I'm really simplifying the calculation by calculating B(2;1000,1/2.28E6) instead of "at least 2 wins." The combinatorial coefficient = 1000!/(2! * 998!) = (1000 * 999)/2 = 499500. Probability of 2 wins: (1/2.28E6)2 = 0.192366882E-13 Probability of 998 losses = (1 - 1/2.28E6)998 = 0.99999956998 = 0.999562376 Total probability: 499500 * 0.192366882E-13 * 0.999562376 = 9.6087257559e-9 * 0.999562376 = 9.604520747e-9, or about 1e-8 The odds are about 1:100 million Did I fuck up any calculations? 1 point·7 years ago·edited 7 years ago Well, choose any N you like. 1000! is a huge, huge number, and many calculators will not like you for inputting this, so let's use something smaller. Let's take the simplest version and calculate the odds that he scores exactly two wins in say playing once a week for a year. Then he plays 2 games a week for about 52 weeks, so that N = 104. Then we want (N!/((N-k)!k!))((pk)*qN-k) which will give us the chance of exactly k successes in N trials, k = 2, N = 104, and then we already said p = 2.28E-6, q = 1- p. Plugging in those numbers, you get 1.03E-9, or about 1 in a billion. As I said this only for exactly two wins after trying 104 times, and if you want to find the odds for at least two times, then you would have to perform the same calculation at k = 2, 3,..., 104, then add up each result. That number is not gonna be much bigger than 1 in a billion, because, since p is so low, as k increases, notice that pk gets exponentially smaller, and qN-k gets extremely close to 1, so that the closer k is to N, the more ridiculously small your end result will be. So when you add them all up, the terms with k > 2 are really small. edit: typo 1 point·7 years ago Most normal calculators overflow at around 69! But we really just need n choose 2 which is n(n-1)/2 not so hard even for large numbers 1 point·7 years ago To all the people who are saying there are "too many unknowns, there is actually only 1 unknown, and that is N, or how many times he played. (I realize the later calculation is N = days he played both games. Be careful!) You can read the article to get a rough estimate for that. It says he won the first one in some year after playing for a certain amount of time, and then he won again after some other amount of time. Choose a reasonable rate at which he would play the game, and then multiply it by the amount of time that he played it, and that's your N. See below, where I choose N = 104. 2 points·7 years ago after re-reading, it says he actually won both between june and september. So, that's like 4 months if we go from June 1 to September 30. Let's says he played both games every day, so 4 x 30 = 120, and he played twice a day so that was N = 240. The chance of winning exactly twice in 240 trials at p = 1/2.28million is 5.52 x 10-9 or a little over 1 in 100,000,000 Calculated. Original Poster1 point·7 years ago This is the best answer. 7 points·7 years ago Never tell me the odds! 2 points·7 years ago The odds of successfuly navigating an asteroid field are 2 to 1 [deleted] 19 points·7 years ago Err, I think he's right. There's too many unknowns. Original Poster1 point·7 years ago Just because there are too many unknowns doesn't mean it's impossible to calculate. That just makes it difficult to calculate, but certainly possible. He should have said something along the lines of "it's roughly a 1 in 5 trillion chance" [deleted] 14 points·7 years ago But that's false... it's not roughly 1 in 5 trillion. There is simply not enough information available. Talking about the probability of winning on a single ticket of a particular game is unambiguous, but when talking about winning on multiple tickets of a whole bunch of different games being played multiple times... well what exactly is the probability that's trying to be calculated to begin with? You can't just throw probabilities to things out of thin air making all sorts of assumptions. That's how the recession we're in got started after all. 3 points·7 years ago·edited 7 years ago What? Are you saying that when we have one well-defined lottery, we can calculate probability of winning it, but when there are multiple lotteries, we can't? [deleted] 8 points·7 years ago·edited 7 years ago If someone asks you "What is the probability of winning Lotto 649?" or any other specific game, then you can absolutely answer that it's 1 in X per ticket. But if it's just some vague question about winning any possible lottery twice well yeah it's pretty much impossible to answer since given the context of this article the person was playing multiple lotteries multiple times. It is often the case, not just in probabilities but also in computer science, that dealing with one phenomenon is unambiguous and well defined, but when you move from the singular to the plural, you need to be very very careful. 2 points·7 years ago Ah, I understand you now. We can't calculate probability of winning two of X lotteries, when we have not enough data about X. However, chances of winning single lottery is usually so small, that I don't think he participated in enough of them to make statistical difference, so "roughly 1 in 5 trillion" is good number, if you think it includes such numbers as "100 in 1 trillion" (case of 500 tickets) Giving it a second thought, he already had 1 million$, so he could buy enough tickets to make difference.

-3 points·7 years ago

And in this case, we have two very clearly defined odds that compound to roughly 1:5 trillion. You're over-complicating this, you only need the odds of winning each of these two specific lotteries. If you were trying to lock down a system that increased your odds of winning both lotteries, then you'd need a whole hell of a lot more info, but that's not the question at hand.

3 points·7 years ago

Say P(event) = 0.1 and P(not event) = 0.9. It's really really easy to say that P(2 events out of 2 trials) = 0.1 * 0.1 = 0.01. But what about P(2 events out of 3 trials)? By your logic it's the same probability, but simple combinatorics shows otherwise: the first and second, first and third, or second and third could all have the "event" being true, making this probability 3(0.1 * 0.1 * 0.9) = 0.027. And P(2 or more events out of 3 trials) = 0.028.

Admittedly, in the lottery case, P(event) is very small, and P(not event) is nearly equal to 1. But if you're playing the lottery several times a week for years, that's enough trials to significantly increase the probability in question, to several times greater than the simplistic "1:5 trillion" mark that's being quoted.

By the way, the distribution I'm talking about is called the Binomial Distribution. Read up on it.

Note: the probability of someone, somewhere winning this lottery twice is actually quite large, but you'd need to know (or make assumptions about) the number of people who play the lottery and the frequency each person plays.

-1 points·7 years ago

the simple 1:5 trillion is the odds that some random schmuck will win the two predefined lotteries, not the odds that that specific man purchasing a specific number of tickets in specific intervals would win.

The odds of a random schmuck winning either of the lotteries that the man in question did: 1:2.28 million The odds of a random schmuck winning both: 1:5 trillion

2 points·7 years ago

You aren't paying attention. The more he plays the lottery, the greater the chance he will win twice. This is (obviously) because the more times you play, the more chances you have to win. The odds aren't nearly 1:5 trillion. See my calculations in response to this post using the Binomial distribution explained above. Using just 1000 purchased lottery tickets (it's common for people to buy waaayyy more in their lifetimes), the "astronomical" 1:5 trillion rockets down to a mere 1:100 million. Chances are, this couple have probably purchased a roll of tickets at a time... but of course, that information is not available. It makes a better story otherwise...

-1 points·7 years ago

I'm paying more than enough attention; if one were to attempt calculating Ernest Pullen's odds of winning $3M, one would need to factor in a whole range of factors but that's not what I'm after. Here's where I think people are getting hung up, our inner nerds want to find out exactly how lucky this dude was and figure out what kind of odds he beat, which is extremely difficult (though not impossible) to calculate. The only information that the lottery peeps can give is the rough odds of any particular ticket you buy being a winner of a particular size. In this case, the odds of winning$1M in lottery A are 1:2.28M. The odds of winning $2M in lottery B are about the same, 1:2.28M. I'm looking for the odds of both tickets I purchase, one from each lottery A & B, winning their respective$1-2M (hint: it's 1:5.2T)

Also, I'm not sure where you went wrong when you got a 1000 ticket purchase to bring the odds of winning both lotteries to 1:100M. I got 1:5.198T to be the odds of purchasing 1 of each lottery ticket and both being winners. If you instead purchased 1000 of each lottery ticket, your odds only improve to 1:5.193T that you would win both lotteries, which correlates to reality since we don't have people winning lotteries left and right.

1 point·7 years ago·edited 7 years ago

Edit: I'm sorry, I have no idea how this got here. I think I confused the orangered with the thread and thought I was responding to two different replies? Shit... Sorry. I'm usually not an asshole by intention. I'm keeping the post though cause I obviously spent too much time on it LOL

The fallacy is assuming the 1:5 trillion number has anything to do with anything meaningful. If someone purchases 2 tickets and only two tickets and wins with both of them, that would be a story for the ages! But this didn't happen. The couple in the story are just 2 people in a very large lottery pool in which a good portion of them buy LOTS of tickets.

Qualitatively speaking, this is what's going on. The probability of winning the lottery using a single ticket is "astronomically" low. The probability of winning the lottery using a bunch of tickets is also low, but still significantly larger. But here's the kicker: the probability of someone, somewhere, in the state winning the lottery like this twice is actually quite high, and given enough time actually approaches 1. This means it's actually less likely that no one wins, than for someone to win. This is why stories about people winning the lottery are a regular occurrence: because the event is a regular occurrence!

Extending this logic to winning twice is not much different. It's certainly more unlikely for the event to happen, but given a large enough time window, it becomes inevitable.

The thing is, you're making a very common mistake: you cherry pick. You hear about the story first, and then you think of the most simplistic case: 2 tickets, 2 wins. But you ignore all the tickets that didn't win, and you ignore all the people who haven't won the lottery twice. You're going about it all backwards. As a result, you're underestimating the odds of the event drastically, and implying (like the article) that events like these are far more special than they are. 1:5 trillion is very pretty. But it doesn't capture the truth at all!

The problem with resorting to such simple calculations/events is that is obscures the truth. This is why 1:5 trillion is such a stupid number: it has no basis on reality whatsoever.

2 points·7 years ago

Of course someone eventually wins the lottery, that's the entire point of the game, play until someone wins then usually play again. You, like most of the people in this thread, are focusing too much on the specifics of this dude winning a bunch of money in the lottery. If the odds of a particular ticket winning lottery A or B is 1:2.28M as stated by the lottery peeps in the article. The odds of a particular ticket in lottery A AND a particular ticket in lottery B both being winners would be roughly 1:5.2T. It has a basis on the officially stated odds of winning each lottery.

It doesn't really mean much because this dude didn't just buy one ticket from each drawing but that's the odds of winning with one of each ticket...

4 points·7 years ago

No, it's something that's impossible to calculate, if the data required for the calculation doesn't exist. And I'd be pretty surprised if that data did exist.

3 points·7 years ago

Cause pulling numbers out of your ass under pressure makes you far less ignorant? How about learning the nuances of reading and taking particular notice of the fact the statement your attributing to him directly isn't quoted but the rest of the text is attributed to him is. This means that's not exactly what he said. He could have very well simply said something along the lines of: There are a lot of unknowns with the two games being separate it's simply not possible for us to give you those odds. The reporter went hrm that concept is way above an 8th grade education, how about it's impossible to calculate, done.

[deleted]
7 points·7 years ago

I guess it depends on how you phrase the question. But regardless, it's entirely possible to calculate the odds.

3 points·7 years ago

What are the odds of two independant and separate people writing the exact same song. I would say that it is impossible to calculate but it could happen.

3 points·7 years ago

Isn't this like the birthday problem? The odds of any particular person winning two lotteries twice are low, but the odds that someone will win two lotteries is higher than one might expect.

-1 points·7 years ago

that "someone" will win two lotteries in a row is the exact odds of winning one - just imagine a game that was restricted to only those who have won a lottery before, their odds to win would be exactly the odds of winning the second game :)

1 point·7 years ago·edited 7 years ago

You kind of plucked that in a row from nowhere.

1 point·7 years ago

I don't think you understand the conditions; being in a row or being twice in your lifetime would have the exact same odds if the winner were to just buy one ticket for each prize. Any more than two and the winner is improving the odds of winning thereby making the question not "what were the odds it would happen to that individual" but rather "how many tickets must someone purchase to get a certain likelihood of winning twice"

1 point·7 years ago

being in a row or being twice in your lifetime would have the exact same odds if the winner were to just buy one ticket for each prize.

This is true. But “if the winner were to just buy one ticket for each prize”, the winner would not be Ernest Pullen.

"what were the odds it would happen to that individual"

That individual bought more than two tickets, improving the odds of winning twice. To answer your own question as you state it, those tickets need to be taken into account.

To know what the likelihood was of Ernest Pullen winning twice, we need to know how many tickets he purchased. His chance of winning twice is a function of how many times he tried. The fact that “how many tickets must someone purchase to get a certain likelihood of winning twice” can be answered is testament to that.

The function in question is high school math. p=1/2280000. All we need is how many tickets he bought for all lotteries in his lifetime… except we don’t have that, so I suppose it’s impossible to calculate the odds.

1 point·7 years ago

what exactly do you think my point is? just curious because it sounds like you think you are countering my point.

1 point·7 years ago

I thought I was doing that too… I believed your point, basically, to be that the scenario of winning twice from two tickets was applicable to both the comment you were replying to and to the scenario in the article.

My first comment simply pointed out that while the previous commenter was discussing winning two lotteries ever, you changed to discussing two in a row. Since you otherwise appeared to be clarifying what he said, that would seem to imply that you didn’t realise that you had done so.

In the second comment, you seemed be saying that it was valid and necessary to assume that only one ticket is bought for each victory.

You said that and that if we looked at more than two tickets, we’d be asking the wrong question.

My point was that the “wrong question” was equivalent to the “right” one, and that even though the number of tickets not referred to as such in the “right” question, the number is needed to answer it. Because for the sake of the question, the “individual” is merely a pile of tickets purchased.

I can’t really interpret what you’ve said in a way that agrees with that.

2 points·7 years ago

I see, we need to meet up over a beer to discuss further - I was actually pointing out that the OP's statement "but the odds that someone will win two lotteries is higher than one might expect" is indeed a true statement and better than some of the comments suggested (someone thought the odds were 5 billion to one) and very simple to calculate presuming one previous winner (they are out there!) purchasing one ticket to, let's say, tomorrow's drawing.

I see a problem that I might be able to solve, I never meant to imply that I was referring to the actual winner from the story. When I said "that individual" I meant a hypothetical winner that purchased only two tickets with both being winners. I then made the point that if let's say, someone began buying up many tickets, very likely what the actual guy from the story did, then the question is not what are the odds of him winning but rather how many tickets does it take to buy until he has a statistical advantage to "win" a grand prize.

Original Poster8 points·7 years ago

I'm so used to reading Reddit comments, that I expected to immediately see someone point out the ridiculous statement in the Yahoo comments.

Instead, people are wondering how the $1 million dropped down to$700k before taxes are paid out and how the guy is just being repaid via karma from his years serving in the army (of course neglecting the fact that the overwhelming majority of vets get f'ed over)

Basically, what I'm saying is, I love you Reddit.

0 points·7 years ago

So far I hate Reddit... the grasp of simple concepts of probability are lost amongst many in this thread...

[deleted]
2 points·7 years ago

Hahaha, oh wow.

Related

2 points·7 years ago

100% percent chance that he won twice!

[deleted]
2 points·7 years ago

Stop being pedantic. It's impossible to calculate because it's impossible to determine all of the variables, not because the math is actually impossible.

2 points·7 years ago

What is really funny is how you called the reporter/source out for making this claim without really showing how the calculation should be done.

If I go out and buy two lottery tickets, for separate games, the calculation of me winning both of them is straightforward. If this guy won the lottery in the past, it is likely that he buys lottery tickets frequently so that is going to skew the odds. Also, are we calculating the probability of this particular fellow winning the lottery twice, or are we calculating the probability of someone winning the lottery twice. The latter would be a far different number, probably 1.

Original Poster1 point·7 years ago

I never claimed that I could come up with the correct formula - there are too many variables involved. What I had a problem with is that the official said it was IMPOSSIBLE to calculate.

2 points·7 years ago

I would argue the point that the lottery official was trying to make is that the hard data odds of winning are easy to calculate if you can assume the winner bought one ticket for each lottery prize that he won and not another ticket. But let's assume he bought an unknown number of tickets for one or both games. Also assume he bought tickets for other games that he did not win. He could have purchased $20,000 worth of tickets for 50 different big prize games with the first$1M he won improving his odds at being a repeat winner. While still not impossible to calculate, I agree, it would be a lot easier to just say it is than explain the task is too tedious to bother.

[deleted]
5 points·7 years ago

Because they're independent games, it is impossible to calculate the odds, Wells said.

Must be a form of Creationist math.

4 points·7 years ago

The odds... are big. Really big. You just won't believe how vastly hugely mindboggingly big they are...

2 points·7 years ago

Minnesota did <a href="http://www.muttrox.com/index.php/2007/02/in-which-we-are-smarter-than-the-minnesota-lottery/">the same thing </a>a couple years ago. They were slightly better, they said the odds were only "virtually incalcuable".

[deleted]
4 points·7 years ago
[link text](http://google.com)

[deleted]
2 points·7 years ago

Check out the 'formatting help' link at the bottom of the comment box for tips on how to make links work on Reddit.

2 points·7 years ago

The odds of this happening is 1. Because it happened.

[deleted]
1 point·7 years ago

Would someone care to do the math then? Isn't it just what is the P(A and B)/ P(B)?

1 point·7 years ago

Nothing is impossible, merely infinitely improbable!

1 point·7 years ago

Once a number becomes sufficiently large, it no longer becomes possible to understand it and therefore doesn't actually exist - it's a mathematical fact.

1 point·7 years ago

The odds of this particular man in this particular situation winning these two games is exactly 100%, because it already happened.

The odds of someone else duplicating this event is something that is difficult to calculate without more information. But I think its safe to say that its pretty damn small.

1 point·7 years ago

I'm from Missouri, so this doesn't intrigue me. It's just one more piece of good ole Missouri ignorance.

Theory of Computing1 point·7 years ago

The fact that this whole thread is full of people trying to prove the lottery official wrong by calculating the correct odds (or by telling each other why the other's method is all wrong), and all coming up with different results, ought to suggest to us that, while certainly not impossible, it's really really hard to get right. Anyone care to calculate the odds that any of the solutions presented here is in fact the correct one? (Not that there really is one "correct" answer anyway, since any probability calculation is dependent upon the assumptions made, and none of us know enough about the variables in play to make a reasonable set of assumptions. But I digress)

1 point·7 years ago

Kim Jong Il: "It will be 911 times 2356."

Chris: "My God, that's... I don't even know what that is!"

Kim Jong Il: "Nobody does!"

1 point·7 years ago

The winners are very likely laundering money, and the officials are covering for them. This technique was very common in situations with corruption and other illegal activities that generated a lot of cash.

1 point·7 years ago

"The chances of winning both? Because they're independent games, it is impossible to calculate the odds, Wells said."

What about multiplying the two probabilities????!!!! Wouldn't that be the probability of winning both? http://en.wikipedia.org/wiki/Independence_%28probability_theory%29#Independent_events

[deleted]
2 points·7 years ago

I actually find it sadder that he took a lump sum. Fixing a wall can't possibly require so much that two annuities just wouldn't be enough.

7 points·7 years ago

I don't know about MO, but in NY, the lump sum is the better financial decision.

-1 points·7 years ago

How so?

You have to pay an incredible amount of taxes that the lottery commission does not have to pay, and you do not have a team of investors making sure the money gives a reasonable return. It is a losing proposition.

Unless NY magically eliminated the federal income tax somehow.

16 points·7 years ago

It's the conventional wisdom that the lump sum is the way to go, primarily because of inflation (the paid amount isn't adjusted for inflation as the years go by). It can be worked out with reasonable accuracy. It even makes up for the high taxes at the outset.

For the lump sum choice, the winner can invest the after-tax money and realize the benefit of the investments over the years that he would be getting small distributed payments for the other option.

It's no contest.

1 point·7 years ago

In addition to what lutusp said, I remember reading when NY introduced the lump sum payout that there were commercially available annuities that paid better than the lottery's annual payout.

This guy got $2 million lump-sum between both awards. You can get some pretty good investment advice if you invest more than$1 million of capital.

0 points·7 years ago

In the US, if the lottery offers a lump sum as an option, you owe the taxes that would be assessed on the lump sum regardless of whether you decide to take the annuity. There's no real advantage to the annuity unless you won one of the few lotteries that don't offer a lump sum option these days.

0 points·7 years ago

It does sound to me to be a pretty simple calculation - you just need to find the probability of winning that lottery once, and if all else remains the same, square it to find out the odds of winning that lottery draw twice in different weeks.

I think the people who are saying that this is impossible to calculate are getting confused with the idea that with scratch-cards, it's very hard to know exactly how many are in circulation at one time, making it hard to tell how many duds there were for every jackpot-winner, but even if that is what they are saying then they're making life very difficult for themselves.

[deleted]
4 points·7 years ago

You need to know how many he bought. Obviously there's a greater chance to win the lottery twice if you buy thousands of tickets than when you buy only two.

0 points·7 years ago

Yes, that's true. I was assuming he'd just done one ticket per draw, which is what I do.

But as you know, if you know the numbers of tickets he bought for each draw, then it certainly doesn't make it impossible to calculate the odds.

1 point·7 years ago

He didn’t win two in a row. He won two in a few months. Even if he bought one ticket for each draw of both lotteries, he’d have bought 25-ish tickets.

2 points·7 years ago

But doesn't the fact that its two different games come into play? Either I don't understand what I'm reading, or several people seem to be ignoring that part.

2 points·7 years ago

Number of trials plays a role too.

1 point·7 years ago

The fact that it's two different games shouldn't be significant. If he's tossing a coin with one hand and rolling a six-sided die with the other, you will know what the probability of getting heads on one AND a six on the other will be, even if they are 'two different games'.

1 point·7 years ago

Probability is context-free. The fun comes from adding context.

Take two people - we'll call them Alice and Bob - and give them a normal, shuffled, deck of playing cards, no jokers, each. Have them draw the top card.

The probability of Alice drawing any given card is 1/52. The probability of Bob drawing any given card is 1/52. Now the fun part.

The probability of them both drawing a given card (not necessarily the same given for each, in fact!) is 1/(52²). Because the givens need not be the same, this can be, effectively, two separate games. It's exactly the same.

You don't actually have to have two decks, even - you could replace the card, reshuffle, and draw again, and it's equivalent. It doesn't matter.

Does that clarify?

1 point·7 years ago

I think so. What was confusing me was that people kept saying that you could just take the odds of winning once and use that to figure out the odds of winning twice, which made no sense to me since the two sets of odds are most likely unrelated.

1 point·7 years ago

Basically, given p₁ = the odds of winning game 1, and p₂ = the odds of winning game 2, the probability of winning both is p₁·p₂. If p₂ is just another round of p₁, then it would be (p₁)².

-2 points·7 years ago

What I find intriguing is the number of people calling it a "miracle" or "blessing" it's statistics, folks, not the work of the imaginary sky-creature.

[deleted]
1 point·7 years ago

What I don't find intriguing is your comment

0 points·7 years ago

I am a mathematician :)

If I buy 1000 lotery tickets each with odds of 1:1,000,000 the odds of me winning two or more tickets is actually about 1:2,000,000

If that sounds wrong you likely don't understand probably.

0 points·7 years ago

It's 100%. It happened.

Community Details

459k

Subscribers

501

Online

### Welcome to r/math!

This subreddit is for discussion of mathematical links and questions. Please read the FAQ and the rules below before posting.

If you're asking for help understanding something mathematical, post in the Simple Question thread or /r/learnmath. This includes reference requests - also see our lists of recommended books and free online resources. Here is a more recent thread with book recommendations.

### r/math Rules

1.
No homework problems
2.
Stay on-topic
3.
Be excellent to each other
4.
No low-effort image posts

Everything about X - every Wednesday

What Are You Working On? - posted Mondays

Career and Education Q&A - Every other Thursday

Simple Questions - Posted Fridays

### Using LaTeX

To view LaTeX on reddit, install one of the following:

MathJax userscript (install Greasemonkey or Tampermonkey first)

[; e^{\pi i} + 1 = 0 ;]

Post the equation above like this:

[; e^{\pi i}+1=0 ;]

### Useful Symbols

Basic Math Symbols

≠ ± ∓ ÷ × ∙ – √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °

Geometry Symbols

∠ ∟ ° ≅ ~ ‖ ⟂ ⫛

Algebra Symbols

≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘∏ ∐ ∑ ⋀ ⋁ ⋂ ⋃ ⨀ ⨁ ⨂ 𝖕 𝖖 𝖗

Set Theory Symbols

∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟

Logic Symbols

¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ↔ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣

Calculus and Analysis Symbols

∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ

Greek Letters

𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔

### Other math subreddits

r/learnmath

65.0k subscribers

r/mathbooks

8.5k subscribers

r/cheatatmathhomework

21.9k subscribers

r/matheducation

11.3k subscribers

r/CasualMath

7.6k subscribers

r/puremathematics

9.1k subscribers

r/mathpics

15.5k subscribers

r/mathriddles

7.2k subscribers

### Related subreddits

r/Mathematica

3.9k subscribers

r/matlab

14.9k subscribers

r/sagemath

538 subscribers

r/actuary

10.0k subscribers

r/algorithms

36.9k subscribers

r/compsci

249k subscribers

r/interdisciplinary

1.5k subscribers

r/statistics

54.3k subscribers


text:
# Infinite Time Horizon, MDP

• Positive Programming, Negative Programming & Discounted Programming.
• Optimality Conditions.

Thus far we have considered finite time Markov decision processes. We now want to solve MDPs of the form

(Notice rewards no longer depend on time.)

Def 1. [Positive, Negative, and Bounded programming] [IDP:PosNegDis]$\;$

Maximizing positive rewards, $r(x,a)\geq 0$ is called positive programming.

Minimizing positive losses, $l(x,a)\geq 0$, is called negative programming.

Maximizing bounded discounted rewards, $|r(x,a)|\leq B$ & $\beta \in (0,1)$ is called discounted programming.

Def 2. [Minimizing Losses]So far we have considered the maximization of rewards; however often we want to minimize losses or costs. When we do so we will use the following notation:

Ex 1. Show that, for positive programming,

Ex 2. [Continued] Show that, for discounted programming,

Ex 3. [Continued] Show that

for a negative program.

Note that negative programming is not simply multiplying positive programming by minus one, because from [3] we see that the terms $C_T(x,\Pi)$ go up and over the optimal loss, while for positive programming each iteration moves towards the optimal objective [1].

## Bellman’s Equation for positive programming

We now discuss Bellman’s equation in the infinite time horizon setting. Previously we solved Markov Decisions Processes inductively with Bellman’s equation. In infinite time, we can not directly apply induction; however, we see that Bellman’s equation still holds and we can use this to solve our MDP.

Thrm 1. Consider a positive program or a discounted program. Given the limit $R(x,\Pi)$ is well defined for each policy $\Pi$, the optimal policy $V(x)$ satisfies

Moreover, if we find a function $R(x)$ such that

and we find a function $\pi(x)$ such that

Then $\pi$ is optimal and $R(x)=R(x,\pi)=V(x)$ the optimal value function.

The above theorem covers the cases of positive and discounted programming. The case of negative programming is a little more subtle. We, now, prove Thrm 1. On first reading, you may wish to take this theorem as a given and skip to [15].

Ex 4. [Proof of Thrm 1] Show that

where $\hat{\Pi}$ is the policy after by policy $\Pi$ after taking action $\pi_0$ from state $x$.

Ex 5. [Continued] Show that

In the following exercise, we let $\pi_\epsilon$ be the policy that chooses action $a$ and then, from the next state $\hat{X}$, follows a policy $\hat{\Pi}_\epsilon$ which satisfies

Ex 6. [Continued] Show that

Ex 7. [Continued]

At this point we have shown the first part of Thrm 1. Now we need to show that a policy that satisfies the Bellman Equation is also optimal.

Ex 8. [Thrm 1, 2nd part] Show that if if we find a function $R(x)$ and a function $\pi(x)$ such that

then $R(x,\pi) = R(x)$.

Ex 9. For positive and discounted programming, suppose that $\Pi$ is a policy satisfying

show that

where here $\tilde{X}_t$ is the random variable representing the state reached by policy $\tilde{\Pi}$ after $t$ steps.

Ex 10. [Continued] Now show that

and thus show that the policy $\Pi$ is optimal.

## Negative Programming

The analogous result to Thrm [IDP:Bellman] for Negative programming is much weaker. This can be see from [IDP:CostLimit] when compared with [[IDP:RewardLimit]]. Essentially interations of negative programming over shoot the optimal value function.

Def 3.  A policy $\Pi$ is called a stationary policy if its action only depends on the current state (and is non-random and does not depend on time).

Ex 11. Consider a MDP with a finite number of actions and assume the Bellman equation has a solution. Show that there is a stationary policy solving the Bellman equation.

Thrm 2. Consider a negative program. Given the limit $C_T(x,\Pi)$ is well defined for each policy $\Pi$, the optimal policy $L(x)$ satisfies

Moreover, any stationary policy $\Pi$ that solves the Bellman equation:

is optimal.

So the Bellman equation is still correct, but as the above result suggests, simply finding a solution to the Bellman equation is not sufficient. We need to find the optimal solution first and then we need to solve with a stationary policy.

Ex 12. Show that the optimal value function satisfies

Ex 13. Argue that the stationary policy $\pi$, described in Thrm 2 satisfies

Ex 14. [Continued] Show that $\Pi$ is optimal i.e.

Ex 15. A gambler has $i$ pounds and wants to win $N$ pounds. The gambler can bet any $j$ less than or equal to $i$. The gambler wins with probability $p$ and loses with probability $q = 1- p$ and wins $j$ or loses $j$. The game and when either $0$ or $N$ is reached. Assuming that $p>1/2$, argue that it is always optimal for the gambler to gamble Gamble 1 pound.

Ex 16. [Geometric stopping or discount factor] Consider a positive program and suppose that after an independent geometrically distributed parameter $\beta$ number of steps the MDP enters an exit state with zero reward. Here a policy $\Pi$ has reward function Argue that this has the same rewards as a discounted program with discount factor $\beta$.

Ans 1. Apply the Monotone Convergence Theorem.

Ans 2. Apply the Bounded Convergence Theorem.

Ans 3. Again apply Monotone Convergence Theorem.

Ans 4. We know that

Applying limits as $t\rightarrow \infty$ on both sides and monotone convergence theorem gives the results.

Ans 5. By [4] and the optimality of $V(x)$

Now maximize the left hand side of the above inequality.

Ans 6. We have that

The first inequality holds by the sub-optimality of $\Pi_\epsilon$ and the second holds by the assumption on $\hat{\Pi}_\epsilon$.

Ans 7. Take the inequality in [6], maximize over $a\in \mathcal A$, and take $\epsilon\rightarrow 0$ gives

The above inequality and [5] give the result.

Ans 8.  It is clear that

Thus by Ex 8 in Markov chains, we have that $R(x,\pi(x)) = R(x)$.

Ans 9. Suppose that policy $\tilde{\Pi}$ follows actions $\tilde{A}_0,...,\tilde{A}_{t-1}$ over states $\tilde{X}_0=x, \tilde{X}_1,...,\tilde{X}_t$. Then applying our initial inequality in [9], we have that

In the second inequality we again apply our initial inequality (this time to the term $R(\tilde{X}_1,\Pi)$. We repeat this $t-1$ times. We, then, note that the terms involving $r(\cdot,\cdot)$ are the total reward of policy $\tilde{\Pi}$ up until time $t$.

Ans 10. By [9] we have that

Since $\tilde \Pi$ is an arbitrary policy and $\Pi$ has higher reward, $\Pi$ must be optimal.

Ans 11. As actions are finite, for each $x$ there exists a $\pi(x)$ solving

Ans 12. Convince yourself that [4-7] apply in this case.

Ans 13.

Ans 14.

So the policy has lower cost, thus is optimal.

Ans 15. The Bellman equation for this problem is

Let $R(i)$ be the reward for the policy that always bets $1$ pound. You can see that $R(i)$ solves the recursion

You can check that $R(i)$ solves the Bellman Equation above: I.e. check

where the maximum above is maximized at $1$. (Hint: verify by differentiation, that the function $f(x) =-p(q/p)^x -q (q/p)^{-x}$ is decreasing.)

The $R(i)$ solves the Bellman Equation and so by Thrm [IDP:Bellman] it is optimal to always bet $1$ pound.

Ans 16.


text:
Return to Question

Post Closed as "off-topic" by Mithoron, Todd Minehardt, tschoppi, Jon Custer, A.K.
2 typography corrected

A 20 lit$$20\ \mathrm l$$ steel cylinder containing $$N_{2(g)}$$$$\ce{N2(g)}$$ at 20atm & 300K$$20\ \mathrm{atm}$$ and $$300\ \mathrm K$$ is kept in a big jar containing air at 1 atm & 300K$$1\ \mathrm{atm}$$ and $$300\ \mathrm K$$ and sealed. $$N_{2(g)}$$$$\ce{N2(g)}$$ starts leaking into the jar but reversibly &and isothermally. When both mechanical &and thermal equilibria are stabilized, pressure in the jar was 1.19 atm$$1.19\ \mathrm{atm}$$. Determine work done by $$N_{2(g)}$$$$\ce{N2(g)}$$.

Since there is mechanical equilibrium, the pressures should be equal to 1.19atm$$1.19\ \mathrm{atm}$$ inside and outside the cylinder with nitrogen. And since temperatures are equal too, should I use this formula for work? $$W=-nRT(ln(\frac{V_{2}}{V_{1}}))$$$$W=-nRT\ln\frac{V_{2}}{V_{1}}$$

A 20 lit steel cylinder containing $$N_{2(g)}$$ at 20atm & 300K is kept in a big jar containing air at 1 atm & 300K and sealed. $$N_{2(g)}$$ starts leaking into the jar but reversibly & isothermally. When both mechanical & thermal equilibria are stabilized, pressure in the jar was 1.19 atm. Determine work done by $$N_{2(g)}$$.

Since there is mechanical equilibrium, the pressures should be equal to 1.19atm inside and outside the cylinder with nitrogen. And since temperatures are equal too, should I use this formula for work? $$W=-nRT(ln(\frac{V_{2}}{V_{1}}))$$

A $$20\ \mathrm l$$ steel cylinder containing $$\ce{N2(g)}$$ at $$20\ \mathrm{atm}$$ and $$300\ \mathrm K$$ is kept in a big jar containing air at $$1\ \mathrm{atm}$$ and $$300\ \mathrm K$$ and sealed. $$\ce{N2(g)}$$ starts leaking into the jar but reversibly and isothermally. When both mechanical and thermal equilibria are stabilized, pressure in the jar was $$1.19\ \mathrm{atm}$$. Determine work done by $$\ce{N2(g)}$$.

Since there is mechanical equilibrium, the pressures should be equal to $$1.19\ \mathrm{atm}$$ inside and outside the cylinder with nitrogen. And since temperatures are equal too, should I use this formula for work? $$W=-nRT\ln\frac{V_{2}}{V_{1}}$$

1

Work done by gas in isothermal process

A 20 lit steel cylinder containing $$N_{2(g)}$$ at 20atm & 300K is kept in a big jar containing air at 1 atm & 300K and sealed. $$N_{2(g)}$$ starts leaking into the jar but reversibly & isothermally. When both mechanical & thermal equilibria are stabilized, pressure in the jar was 1.19 atm. Determine work done by $$N_{2(g)}$$.

Since there is mechanical equilibrium, the pressures should be equal to 1.19atm inside and outside the cylinder with nitrogen. And since temperatures are equal too, should I use this formula for work? $$W=-nRT(ln(\frac{V_{2}}{V_{1}}))$$


text:
# Inverse cosine function

## Definition

The inverse of the cosine function is called the inverse cosine function.

The cosine function represents a value of the ratio of length of the adjacent side to length of the hypotenuse at the associated angle of the triangle, whereas the inverse cosine function represents an angle of the triangle for a value of the ratio of the length of the adjacent side to length of the hypotenuse of the same right angled triangle.

### Function

The inverse cosine is written in short form as $\large \arccos$ or $\large \cos^{-1}$ in mathematics.

As per the fundamental definition of the inverse cosine function, it is written in mathematical form in the following ways.

$\large \cos^{-1} \normalsize \Bigg[\dfrac{Length \, of \, Adjacent \, side}{Length \, of \, Hypotenuse}\Bigg]$ $\,=\,$ $Angle \, of \, the \, Triangle$

It is also written in the following form.

$\large \arccos \normalsize \Bigg[\dfrac{Length \, of \, Adjacent \, side}{Length \, of \, Hypotenuse}\Bigg]$ $\,=\,$ $Angle \, of \, the \, Triangle$

For example, $\Delta CAB$ is a right angled triangle and the angle of the triangle is theta ($\theta$). $\overline{AB}$ and $\overline{AC}$ are adjacent side and hypotenuse and their lengths are represented by $AB$ and $AC$ respectively.

Write the arc cosine function in terms of sides of the triangle $CAB$ to express it in mathematical form.

$\large \cos^{-1} \normalsize \Big(\dfrac{AB}{AC}\Big) \,=\, \theta \,\,\,$ or $\,\,\, \large \arccos \normalsize \Big(\dfrac{AB}{AC}\Big) \,=\, \theta$

Consider $x$ as the quotient of the length of the adjacent side by the length of the hypotenuse.

Then, $\large \cos^{-1} x \,=\, \theta \,\,\,$ or $\,\,\, \large \arccos x \,=\, \theta$

Thus, an inverse cosine function is denoted as $\cos^{-1} x$ or $\arccos x$ in mathematical form.

#### Example

The functionality of the inverse cosine function can be studied from an example.

1. Take ruler and draw a horizontal line and assume the name of left side point is $G$.
2. Take protractor and draw a line with $60^\circ$ angle from point $G$.
3. After that, take compass and set its distance to $14$ cm with the help of a ruler and then draw an arc on $60^\circ$ angle line from point $G$. Call the intersecting point as point $H$.
4. Draw a line from point $H$ to horizontal line but it should intersect the horizontal line perpendicularly at point $I$.

Thus a right angled triangle $HGI$ is constructed geometrically and now measure the length of the adjacent side ($GI$). It should be $7 \, cm$ exactly. The angle of the triangle is $60^\circ$.

Now, express the inverse cosine function in terms of ratio of sides and the respective angle of the triangle.

$\cos^{-1} \Big(\dfrac{7}{14}\Big) \,=\, 60^\circ$

$\implies \require{cancel} \cos^{-1} \Big(\dfrac{\cancel{7}}{\cancel{14}}\Big) \,=\, 60^\circ$

$\implies \cos^{-1} \Big(\dfrac{1}{2}\Big) \,=\, 60^\circ$

$\therefore \,\,\,\,\,\, \cos^{-1} (0.5) \,=\, 60^\circ$

It is also written in mathematical form alternatively.

$\arccos (0.5) \,=\, 60^\circ$

The inverse cosine function represented that the angle of the right angled triangle is $60^\circ$ if $0.5$ is the quotient of the length of the adjust side by the length of the hypotenuse.

Save (or) Share