# what is this mathematical pattern!?

humy
Science 24 May '15 19:33
1. 24 May '15 19:337 edits
I made an extremely complex iterative numerical approach to give estimates of the output of an extremely complex mathematical function (to do with I new type probability that I invented and I am currently researching; but far to complex to explain here ) written in java computer language and I repeatedly run the program.
Because of the way the necessary equations had to be configured, although the input to this function is always a positive whole number, I was sure that the output would always be at a relatively arbitrary point somewhere along real number line and the chances of any being a whole number would be vertically zero. I was also not expecting to see any meaningful mathematical pattern in the output.

BUT, as I run the program again and again for different outputs, and, at a cost of each program run taking longer and longer (up to 20 minutes! ), as I made it iterate ever more times to get a more and more accurate output, I was astonished to noticed a pattern! As I made it more and more accurate, the numbers outputted seen to tend towards certain definite whole numbers, and so much so that I am certain it could not possibly be mere coincidence! This demands an explanation! But first I have to see if I can relate the output to the input algebraically so I can begin to do that. But that is where I have got stuck! Because I fail to see what algebraic equation could define how the output, which I call n, relates to the input, which I call v.

The table below shows each input v value on the left hand column and the corresponding output n on the right hand column.
OK, I hope someone smarter than me can spot what this mathematical patten is:

v (input ) | n (output )

0 --> 1 (note that this output of n=1 for v=0 is a special case and may or may not be relevant here)
1 --> 1
2 --> 3
3 --> 10
4 --> 35
5 --> 126
6 --> 462
7 --> 1716
8 --> 6435
9 --> 24310
10 --> 92378 ?
11 --> 352716 OR 352715 ?
12 --> 1352079 OR 1352078 ?

Some important notes:

Firstly, the input of v=0 there is a SPECIAL CASE and therefore may or may not be mathematically consistent with the outputs given v>0. So, if you think you have almost spotted the pattern but not quite because your equation doesn't work for v=0 above, you are permitted to ignore the special case for v=0 and you have got the answer.

Secondly, note the question marks indicating some uncertainly of the output above. The iteration in my java program works well for the first ~7 or so inputs i.e. v < ~8, but then, as you go down the above table, it gets more and more uncertain which whole number the output tends towards, although the figures above cannot be too far out. So, if you think you have almost spotted the pattern but not quite because your equation doesn't work for v > ~7 above, you are permitted to slightly adjust, but only slightly adjust, those output values for inputs greater than about ~7 to make them fit with your equation.

Obviously, what I ideally want is some equation in the form of:

n = ( ...some expression here with v in it... )

I will be very grateful to anyone's help here.
2. 25 May '15 07:23
Originally posted by humy
Obviously, what I ideally want is some equation in the form of:

n = ( ...some expression here with v in it... )
If my memory serves me correctly, any set of points can be matched using a polynomial. I would expect something like Mathematica to do it for you.

You also said that you expected a somewhat arbitrary output, but your result clearly increases with n.

Have you graphed it?
3. 25 May '15 12:11
If my memory serves me correctly, any set of points can be matched using a polynomial. I would expect something like Mathematica to do it for you.

You also said that you expected a somewhat arbitrary output, but your result clearly increases with n.

Have you graphed it?
Any set of points (indeed, any continuously differentiable function) can be mapped to a polynomial but it's not necessarily going to be a "nice"-looking one.

It looks to me like the data might be proportional to 4^(v-1) with some kind of small polynomial correction.
4. 25 May '15 13:49
Originally posted by KazetNagorra
Any set of points (indeed, any continuously differentiable function) can be mapped to a polynomial but it's not necessarily going to be a "nice"-looking one.
Which makes me wonder about things I have heard with regards to the p vs np problem. Apparently there is something different between polynomial time and exponential time, suggesting that an exponential equation can't be put into a polynomial?
5. 26 May '15 05:53
Which makes me wonder about things I have heard with regards to the p vs np problem. Apparently there is something different between polynomial time and exponential time, suggesting that an exponential equation can't be put into a polynomial?
An exponential can be written in terms of an infinite polynomial series (a Taylor series).

What you are referring to relates to the computational complexity of a problem. Problems that cannot be solved in polynomial time generally are very hard to solve or even approximate. A classic example is the travelling salesman problem.
6. 26 May '15 07:31
Originally posted by KazetNagorra
An exponential can be written in terms of an infinite polynomial series (a Taylor series).
I guessed the solution would be to put infinity in there somewhere. In my defence its been just over 20 years since I studied Taylor series.

What you are referring to relates to the computational complexity of a problem. Problems that cannot be solved in polynomial time generally are very hard to solve or even approximate. A classic example is the travelling salesman problem.
So presumably 'polynomial time' implies a finite order polynomial.
7. 27 May '15 16:019 edits
OK, after working (agonizing ) on this for several days now, I have finally worked out a few things and a few conceptual mistakes I made:
I have discovered that the general formula for this sequence isn't what I really want or need (so, forget about my OP problem ) but rather what I really want and need is the general formula for the pattern in a much more generic matrix output of numbers that are generated by a closely related mathematical function but one with not just one but two inputs; the “ov” input (which, purely out of interest, is the total number of known Observed events so far ) and the “v” input (which, purely out of interest, is the unknown total number of events that are yet-to-be observed ). This is the input and output values ( “n” output ) for just part of the top left-hand corner of this infinitely large matrix:

(each row is for a different ov input value while each column is for a different v input value. Sorry about all the underscores! Don't know how to make the spacing appear right without them! )

____ | v=
ov __|_ 0 _|_ 1 _|_ 2 _|_ 3 _|_ 4 _|_ 5 _| …
0--> _ 3 ___ 1 ___1 ___ 1 __ 1 ___ 1 __ ...
1--> _ 3 ___ 4 ___5 ___ 6 ___7 ___8 __...
2--> _ 3 ___ 7 __ 12 __ 18 _ 25 __ 33 __...
3--> _ 3 __ 10 __ 22 __ 18 _ 25 __ 33 __...
4--> _ 3 __13 __ 35 __ 75 _ 140 _ 238 __...
5--> _ 3 __16 __ 51__ 126 _266 _ 504__...
6--> _ 3 __19 __ 70 __196 _462 _ 966__...
7--> _ 3 __22 __ 92 __288 _ 750_1716__...
:
:
Now this looks more promising because I am seeing definite patterns here!

First, considering the first 3 rows:

for ov=0, if v=0 then n=3 else n =1
for ov=1, n = v + 3
for ov=2, n = (v + 1)( v/2 + 3 )

But then the formula I worked out for ov=3 becomes horribly complicated and requires an iteration that becomes impractical as you go further and further down so, unless I can come up with a better formula, preferably one that is none iterative, that doesn't help me much!

OK, now considering the first 2 columns:

for v=0, n = 3
for v=1, n = (1 + 3*ov )

But then I get completely stick for the v=2 column! But I am hoping that if I can get the formula for v=2 column, it wouldn't be iterative.

Another approach would be to look for a mathematical pattern in the lines of numbers going diagonally; in either of the two directions. I have already tried that but, so far, no result.

Ideally, what I want, if such a thing exists, is a general formula for the WHOLE of the matrix i.e. for n given any ov and v input.

Anyone care for a try?
8. 27 May '15 17:303 edits
Originally posted by humy
OK, after working (agonizing ) on this for several days now, I have finally worked out a few things and a few conceptual mistakes I made:
I have discovered that the general formula for this sequence isn't what I really want or need (so, forget about my OP problem ) but rather what I really want and need is the general formula for the pattern in a much more gen ...[text shortened]... rmula for the WHOLE of the matrix i.e. for n given any ov and v input.

Anyone care for a try?
On reflection, I think the table would be slightly less likely to lead to misunderstand if presented thus:

_____| v=0 _| v=1 _| v=2 _| v=3 _| v=4 _| v=5 _| …
ov=0 ___ 3 ___ 1 ___ 1 ___ 1 ____1 ____1 __ ...
ov=1 ___ 3 ___ 4 ___ 5 ___ 6 ____7 ____8 __...
ov=2 ___ 3 ___ 7 ___12 __ 18 ___25 ___33 __...
ov=3 ___ 3 ___10 __ 22 __ 18 ___25 ___33 __...
ov=4 ___ 3 ___13 __ 35 __ 75 __ 140 __238 __...
ov=5 ___ 3 ___16 __ 51__ 126 __266 __504__...
ov=6 ___ 3 ___19 __ 70 __196 __462 __966__...
ov=7 ___ 3 ___22 __ 92 __288 __750__1716__...
:
:

But it's still very awkward to edit this!
9. 28 May '15 17:383 edits
Originally posted by humy
On reflection, I think the table would be slightly less likely to lead to misunderstand if presented thus:

_____| v=0 _| v=1 _| v=2 _| v=3 _| v=4 _| v=5 _| …
ov=0 ___ 3 ___ 1 ___ 1 ___ 1 ____1 ____1 __ ...
ov=1 ___ 3 ___ 4 ___ 5 ___ 6 ____7 ____8 __...
ov=2 ___ 3 ___ 7 ___12 __ 18 ___25 ___33 __...
ov=3 ___ 3 ___10 __ 22 __ 18 ___25 ___33 __...
ov= ...[text shortened]... v=7 ___ 3 ___22 __ 92 __288 __750__1716__...
:
:

But it's still very awkward to edit this!
ARR I have just spotted the pattern right now!
Providing you just ignore the v and ov values and don't try and see a pattern in terms of v and ov, it is glaringly obvious right in front of your eyes!!!
Did anyone spot it?
If you haven't spotted it yet, just completely forget about the ov and v numbers because they are a red herring, just see if you can see it in terms NOT in any way related to the row and column numbers before reading the rest of this post and look for a very SIMPLE pattern!

OK, if you still haven't spotted it and give up:

First just unconditionally accept that the first column has number 3 in all its cells (a "cell" is an entry with a unique row and column number coordinate in the table ) and the first row, except for its first cell, has number 1 in all its cells.
In other words, just accept that the first row and column has values:

3 _ 1 _ 1 _ 1 _ 1 _ 1 _ 1 _ 1 _ 1 _ 1 _ 1 _ 1 _ 1 _ ....
3
3
3
3
3
3
3
:
:

OK, now simply apply the rule that, for each of the cells not in the first column or the first row, the number it contains is simply the sum of the number in the cell immediately to the left of it and the number in the cell immediately above it; -it really was that simple! but I guess I wasn't the only one not to spot it until just now!

The pattern isn't exactly the kind of pattern I was looking for but, for my purposes, this will certainly do!
I have now discovered a totally new kind of probability and some of its important properties and plan to put that in my book that I will eventually get published.

One thing I will have a go at in due course is to see if I can work out WHY that mathematical function produces that pattern! Because, for now at least, its a complete mystery to me!
It wouldn't really matter for my work if I couldn't explain why, but still nice to explain why I think.
10. 28 May '15 19:08
Originally posted by humy
OK, now simply apply the rule that, for each of the cells not in the first column or the first row, the number it contains is simply the sum of the number in the cell immediately to the left of it and the number in the cell immediately above it; -it really was that simple! but I guess I wasn't the only one not to spot it until just now!
Something goes wrong at 3,3.
11. 28 May '15 19:321 edit
Something goes wrong at 3,3.
Arr, well spotted. That was a misprint. Sorry about that. It should have been:

_____| v=0 _| v=1 _| v=2 _| v=3 _| v=4 _| v=5 _| …
ov=0 ___ 3 ___ 1 ___ 1 ___ 1 ____1 ____1 __ ...
ov=1 ___ 3 ___ 4 ___ 5 ___ 6 ____7 ____8 __...
ov=2 ___ 3 ___ 7 ___12 __ 18 ___25 ___33 __...
ov=3 ___ 3 ___10 __ 22 __ 40 ___65 ___96 __...
ov=4 ___ 3 ___13 __ 35 __ 75 __ 140 __238 __...
ov=5 ___ 3 ___16 __ 51__ 126 __266 __504__...
ov=6 ___ 3 ___19 __ 70 __196 __462 __966__...
ov=7 ___ 3 ___22 __ 92 __288 __750__1716__...
:
:

This above numbers are now the actual output of my program.
Editing this table on this forum is a tedious slow difficult son of a bitch! All too easy to get it wrong.
12. 28 May '15 19:39
Originally posted by humy
Arr, well spotted. That was a misprint. Sorry about that. It should have been:

_____| v=0 _| v=1 _| v=2 _| v=3 _| v=4 _| v=5 _| …
ov=0 ___ 3 ___ 1 ___ 1 ___ 1 ____1 ____1 __ ...
ov=1 ___ 3 ___ 4 ___ 5 ___ 6 ____7 ____8 __...
ov=2 ___ 3 ___ 7 ___12 __ 18 ___25 ___33 __...
ov=3 ___ 3 ___10 __ 22 __ 40 ___65 ___96 __...
ov=4 ___ 3 ___13 __ 35 __ 75 __ 140 ...[text shortened]... is table on this forum is a tedious slow difficult son of a bitch! All too easy to get it wrong.
Ever seen this?

http://en.wikipedia.org/wiki/Pascal%27s_triangle
13. 29 May '15 08:035 edits
Originally posted by KazetNagorra
Ever seen this?

http://en.wikipedia.org/wiki/Pascal%27s_triangle
arr yes, I thought my pattern looked familiar!

My mathematical pattern is very similar to Pascal’s triangle except:

1, it is more like Blaise Pascal's version of Pascal's triangle, and can be presented as a square rather than a triangle.

2, the first column is all 3s rather than all 1s. One effect of this is, unlike Blaise Pascal's version of Pascal's triangle, in square form and assuming that the number of rows are made the same as the number of columns, it still makes the table of values asymmetrical through the diagonal axes from the top left hand corner to the bottom right hand corner.

Stated more simply, it is a rather 'skewed' version of Pascal's triangle.
So perhaps I should name it "skewed Blaise" or "skewed Pascal"?
I am still trying to think up names for this.

Just noticed I could use a more complicated version of Binomial expansions, that can be derived from Pascal’s triangle, but to work out the values I have created here. But that looks quite complex and I am not sure if it would be worth me doing that.