Australian (ASX) Stock Market Forum

The Random Number Generator - One of the best Maths problems ever IMO

Market prices are often modelled as a random walk, meaning that each price movement is independent of the last (ie the price movement is driven by white noise) - this doesn't mean we know its probability distribution and it certainly wont be uniform, it is probably closer to gaussian.

You are right. It is probably as long ago since I read A Random Walk Down Wall Street as it is since I first encountered this problem. If I recall correctly the randomness he was modelling was based purely on a 50% chance that the next move would be up or down 1 unit from where it currently is, similar to walking, which is where the title obviously comes from.
 
bellenuit,

There are some economists, for example Burton Malkiel who wrote A Random Walk Down Wall Street, who hold that share price movements are indistinguishable from completely random movements

Which is why they are no good at trading...

What is a random movement?? Can anybody prove that such a thing exists??

Every man and his dog can quickly and easily see that a stock say BHP has moved up from ~$36 to $41 over the last 2 weeks. Consciously or subconsciously this will affect what many participants in the market do with this stock tomorrow. For an event to be compared with 'random' there can be no memory from prior events, clearly in this case memory comes into it.

All the 'information' about randomness and markets is written by those who don't have a clue what's going on. Money is being transferred from those without a clue to those that do know.

brty
 
Which is why they are no good at trading...

What is a random movement?? Can anybody prove that such a thing exists??

Every man and his dog can quickly and easily see that a stock say BHP has moved up from ~$36 to $41 over the last 2 weeks. Consciously or subconsciously this will affect what many participants in the market do with this stock tomorrow. For an event to be compared with 'random' there can be no memory from prior events, clearly in this case memory comes into it.
brty

To be fair to Burton Malkiel, I actually misstated what he wrote by that statement and Schnootle corrected me.

I'm really digging into my memory, but he generated graphs of a hypothetical share where the next move was completely random in the sense that it could be up or down (maybe sideways too), but only by 1 unit from where it currently is. The next move after that would be randomly up or down (or sideways) one unit from the new point. So this has the memory of prior events that you mentioned as each move can only be 1 unit away at most from where the previous move ended.

He then showed those graphs to stock chartists who look for the typical patterns that chartists look for (head and shoulder patterns etc.) and mixed then in with some charts of actual stocks. Apparently the chartists could not tell which were the hypothetical stocks and which were the real.

I am not trying to defend his arguments and can't in any case as I remember so little from the book. But it is a fairly well respected work in the industry, so I wouldn't dismiss him offhand.
 
bellenuit,

I am not having a go at you at all, I apologise if it came across that way. I am having a go at "random", a concept I do not believe in.

This bit is what annoys me about randomness and peoples acceptance of it....

he generated graphs of a hypothetical share where the next move was completely random

I seriously doubt the graph was completely random, because it was produced by a computer that had been given instructions.

The task of a trader is to make money from movements, not to identify if a chart is a stock or made up. Were any systems tested on the data presented?? I think not (I have his book and read it, it is full of holes and excuses, from memory)

brty
 
I seriously doubt the graph was completely random, because it was produced by a computer that had been given instructions.

brty

some pseudo-random numbers are pretty bloody good, and besides he may have used other sources of randomness - like atmospheric noise http://www.random.org/

A lot of incredibly smart people have used valid arguments and rigor on both sides of the random walk / efficient markets hypothesis, we cant discount either

But i suppose the proof of the pudding is in the eating, if you have been making money using nothing but charting techniques then that is a valid argument too.
 
I tried the jellyfish backgammon for an hour and then promptly removed the program. Strangely the computer 'often' drew more doubles, drew the exact numbers it needed and the last straw was when I finally drew double sixes, jellyfish followed with two double sixes in a row. ;)

And it doubles up all the time which was annoying.
Lol - yep, One certainly gets the feeling that the games have been made intentionally "interesting" - It may not be random - although you can force it to be random, see d) below - but I don't believe it's rigged, for the following reasons :-

[Disclaimer ... I'm fairly sure this applies to Jellyfish Lite - don't waste too much time on it in case I'm wrong - assuming you can be bothered reading this as well lol - I currently only have access to my work computer- and don't usually play games on it to confirm ... so the following is from memory]

a) each sequence of rolls is logged in the memory as "a prerecorded game" and can be repeated -
b) and in the re-run you can try alternative rolls at various "checkpoints" and see if you'd have won if you'd jumped left instead of right etc (gotta feeling it gives hints as well)
c) you can even swap roles (or rolls if you prefer) with the computer, i.e. he gets the white rolls, you get the brown, - That way for instance he'd have rolled the double six, and you'd have countered with two double sixes lol.
d) if you're not happy with those "prerecorded games / roll sequences", you can make a sequence of your own choosing - i.e. rolling dice in the background - then there's no question of the rolls being random

e) my goal was (still is) to beat the computer (first time up) on any one game no matter which set of rolls I play, white or brown. Lol - still working on that one, - there has been a long pause in my efforts towards that goal as well. Note that you can set the difficulty level a few down from "maximum" - makes the bludy computer a bit more "human" in the errors department lol.:2twocents

PS - you mention doubling - it sure sharpens up your skills with respect to reading a game and knowing when to double. - "know when you hold , when to fold" etc. Like, you double when you think you have a 70% chance of winning as they say - lol - I used to play 3 other blokes once a week for a few dollars. One bloke thought he was playing poker - and when you doubled him - no sooner was the doubling cube turned, and he'd double you back - claiming you were "bluffing" lol. (like ... the facts are out there for all to see) - He contributed the most dollars to the kitty.

PS when I said back there that I rolled 5 double 5's in a row, then not again for a month - I was talking real dice. So much for the "randomness of dice", lol ;)
 
Variant to that "wife-choosing game" - you put 4 blokes and 4 girls in a room - you ask em to pair up "for life" - and you work out a tactic - employed by the men and girls alike - whereby the sum of the mismatches in partners as finally self-chosen is minimised.

Hang on, I think I just described "reality" ;) - "So this is reality, hope it didn't mess up your mind "

REminds me , when I was a student, there was a Computer Ball - where we all put our names in a hat, - together with a six page questionnaire - and the computer sorted us into "double blind dates". One of my friends married his partner of that night - still super happy together.

Only later did the computer programmer ( one of our number) admit that all he did was match us up on question 18 ... "political leaning" lol :2twocents
 
To be fair to Burton Malkiel, I actually misstated what he wrote by that statement and Schnootle corrected me.

I'm really digging into my memory, but he generated graphs of a hypothetical share where the next move was completely random in the sense that it could be up or down (maybe sideways too), but only by 1 unit from where it currently is. The next move after that would be randomly up or down (or sideways) one unit from the new point. So this has the memory of prior events that you mentioned as each move can only be 1 unit away at most from where the previous move ended.

He then showed those graphs to stock chartists who look for the typical patterns that chartists look for (head and shoulder patterns etc.) and mixed then in with some charts of actual stocks. Apparently the chartists could not tell which were the hypothetical stocks and which were the real.

I am not trying to defend his arguments and can't in any case as I remember so little from the book. But it is a fairly well respected work in the industry, so I wouldn't dismiss him offhand.

All he's proved is that:

1. Using random generator can produce charts that look like real.

2. Real share charts can look like those produced by random generator.

3. Chartists can't tell the two apart.

It doesn't follow that real shares follow a random pattern. There is a leap in logic there imo.
 
schnootle,

he may have used other sources of randomness - like atmospheric noise

How is atmospheric noise random?? There is a huge leap between we can't predict it/calculate it, and something that is random. Random means no order to outcomes, not we can't predict the outcome. Therefore things appear random to those without a clue as to what is driving an event /(series of events).

The fallback line for the random believers when challenged that nothing is random, is along the lines of "as good as random", which really means 'we have not worked out how to calculate it yet'.

The concept of random is something that exists in the minds of mathematicians, not in the real universe, yet the concept has permeated all types of thinking in the modern world.

brty
 
even randomness has to be defined m8 - like .. chosen from pink noise vs white noise etc :2twocents

Part of my debate here was the illusion that mathematicians create with the chance "theory". Is the graph provided by schnootle showing the statistical reality or a proven reality? Nothing wrong with those results. Wrong 63% of the time is terrible odds but the chances are better than 0 and less than 50%.

Take this formula below to any game of chance and see how it stacks up. :eek: Oh and remember your if's.

A discrete-time martingale is a discrete-time stochastic process (i.e., a sequence of random variables) X1, X2, X3, ... that satisfies for all n

\mathbf{E} ( \vert X_n \vert )< \infty

\mathbf{E} (X_{n+1}\mid X_1,\ldots,X_n)=X_n,

i.e., the conditional expected value of the next observation, given all the past observations, is equal to the last observation.

Somewhat more generally, a sequence Y1, Y2, Y3 ... is said to be a martingale with respect to another sequence X1, X2, X3 ... if for all n

\mathbf{E} ( \vert Y_n \vert )< \infty

\mathbf{E} (Y_{n+1}\mid X_1,\ldots,X_n)=Y_n. The sequence Xi is sometimes known as the filtration.

Similarly, a continuous-time martingale with respect to the stochastic process Xt is a stochastic process Yt such that for all t

\mathbf{E} ( \vert Y_t \vert )<\infty

\mathbf{E} ( Y_{t} \mid \{ X_{\tau}, \tau \leq s \} ) = Y_s, \ \forall\ s \leq t.
 
schnootle,

How is atmospheric noise random?

brty

Yes you could argue that atmospheric noise is deterministic, however its complexity is such that in practice it is an excellent source of entropy.

The concept of random is something that exists in the minds of mathematicians, not in the real universe, yet the concept has permeated all types of thinking in the modern world.

Now we are in the sticky "does god play dice" territory. Pre-Quantum Mechanics the concept of randomness may have been only a mathematical construct, now physicist love it too. If you agree with quantum mechanics then everything at the quantum level is inherently unpredictable, then radio-active decay is an perfect source or randomness.

Quantum mechanics as a theory as been incredibly successful, so it is entirely possible that randomness is intrinsic to the universe - not just a mathematical concept.
 
Quantum mechanics as a theory as been incredibly successful, so it is entirely possible that randomness is intrinsic to the universe - not just a mathematical concept.
My observation of the universe has evidence that everything is in order. Organics are observed to reproduce with the same species and choose their food for example. Whereas non-organics are harder to define but since they are required for organics to exist, then the order is there too. :)
 
schnootle,

The randomness claimed for quantum mechanics has no foundation in mathematics and it appears to be impossible to construct such a foundation. This does not make it wrong but suggests there are problems in our existing conceptual framework. It also means that physicists when arguing about these issues are debating philosophy with no objective way of deciding the issue.

from....

http://www.mtnmath.com/whatrh/node77.html

Is quantum mechanics fact, or a series of concepts and theories that seem to mimmick/explain reality??

This bit....

everything at the quantum level is inherently unpredictable

...is only because we have not worked out how to do it, does not mean it is random.

brty
 
My solution to the rng problem is simple and determining the probability of successfully using this strategy is not difficult.

The solution is

ignore the first number.
if the second number is larger than the first, choose it, else
if the third number is larger than the first, choose it, else
if the fourth number is larger than the first, choose it, else
-
follow the pattern
-
if the second last number is larger than the first, choose it, else
if the last number is larger than the first, choose it, else
choose the last number even though you know it is not the highest.

Using this strategy I determined that the probability of picking the highest number is slightly larger than 0.25. More preciously 0.25*(999)/(998).

In this rng problem there are 1000 numbers, if we let the number of numbers be a variable say, n. Then the probability of choosing the highest number using this strategy is,

p = 0.25*(n-1)/(n-2).

How to determine the form of p:

I looked at a simplified problem with n=3 determined the probability of success using this strategy and found it to be p = 50% = 1/4 * 2

then I looked at n=4 and found p = 37.5% = 1/8 * 3

then I looked at n=5 and found p = 25% = 1/12 * 4

which leads to the pattern p = 0.25*(n-1)/(n-2).

I assume that the same analysis I used to determine the above will hold for any n. Why wouldn't it?

Anyone disagree/ agree with the method or with p = 0.25*(999)/(998).
 
The solution is

ignore the first number.
if the second number is larger than the first, choose it, else
if the third number is larger than the first, choose it, else
if the fourth number is larger than the first, choose it, else
-
follow the pattern
-
if the second last number is larger than the first, choose it, else
if the last number is larger than the first, choose it, else
choose the last number even though you know it is not the highest.

Using this strategy I determined that the probability of picking the highest number is slightly larger than 0.25. More preciously 0.25*(999)/(998).

Remember the question was:

Assuming you are a perfect logician and will try and maximise your chances of identifying the highest number, what is your chance of doing so (i.e. that your name will be printed beside the highest number)?

So the answer given previously had a higher chance of success than your method, as its probability of success was 1/e, or 0.37, compared to your 0.25.
 
Top