Lexicographic Index & Sums

Alexafjb

Member
Super!!!

Hi PAB

I want to thank you once again for all your hair pulling hard work that you put into this!
Incredible speed to it.
Now to put it to use!!!! Maybe:
"Santa will give Icewynd his Christmas wish after all" LOL

What I'm finding interesting is the fact that the combinations are very low in count!

Would I screw up the code if I REM'd out say DN3 and DN4 and the DN error Check to try and produce a lower DN input?
I imagine if it worked the result combinations would increase?

My reasoning here is that usually, one can get close if not right on with choosing one number in the next draw.
When it comes to theory, I'm a visual pen and paper guy I like to see the spread of the past histories and note the CSN of the past history along with the sums and if I feel a number is going to repeat or hit next or is due I like to pick a sum and see the spread of the CSN and compare it to the history.

Anyway What you think?

THX!!!

Cheers.
Alex.:agree:
 

PAB

Member
Hi Alex,

Alexafjb said:
I want to thank you once again for all your hair pulling hard work that you put into this!
Incredible speed to it.
Now to put it to use!!!!
You're welcome!

Alexafjb said:
Maybe: "Santa will give Icewynd his Christmas wish after all."
Don't understand this bit, sorry!

Alexafjb said:
What I'm finding interesting is the fact that the combinations are very low in count!
If I understand you correctly, this is because the CONSTANT Numbers 24, 25, 26, & 49 already add up to 124 which only leaves 16 to make up the 140.

Alexafjb said:
Would I screw up the code if I REM'd out say DN3 and DN4 and the DN error Check to try and produce a lower DN input?
I imagine if it worked the result combinations would increase?
YES, because it is set for FOUR DN numbers.
You could easily change the code if you wanted to so that would work.

Alexafjb said:
I like to pick a sum and see the spread of the CSN and compare it to the history.
BTW, if you want the TRUE Lex combination number, instead of the number of combinations produced due to the criteria set, then use the formula from the DataBase file that I sent you and incorporate that formula into the code, starting at cell R4 and continuing down.

I hope this helps!

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Alexafjb

Member
PAB

Now to put it to use!!!! Maybe:
"Santa will give Icewynd his Christmas wish after all" LOL
This refers to a note to Santa in another thread that Icewyd wrote! (You got to get out more! PAB)

BTW, if you want the TRUE Lex combination number, instead of the number of combinations produced due to the criteria set, then use the formula from the DataBase file that I sent you and incorporate that formula into the code, starting at cell R4 and continuing down.

Going to look into doing that!

I'm already messing with the code! "Yes" I made a renamed Back up.

Interesting how the Mod reacted.
This is what I did 1st attempt to reduce the DN to 3 instead of 4, and I landed up with a "Hole" in the "Results" Mind you it's all an exercise in learning. You might have to explain to me "MyArray("A" & "B")

1) 'Dim DN4 As Integer

2)With Application
.ScreenUpdating = False: .Calculation = xlCalculationManual: '.DisplayAlerts = False
End With

3)'DN4 = Range("E6").Value
'Following removed + DN4
Sum = DN1 + DN2 + DN3 + MyArray(A) + MyArray(B)

4) 'ActiveCell.Offset(0, 5).Value = DN4
'ActiveCell.Offset(0, 5).NumberFormat = ("00")
I think this created the hole in "Results".

5) As per your instructions to fix the SORT.

'Range("G4", Range("Q" & Rows.Count).End(xlDown)).Sort _
Key1:=Range("Q4"), Order1:=xlDescending, Header:=xlNo, _
Key2:=Range("G4"), Order2:=xlAscending, Header:=xlNo

6)With Application
'Removed .DisplayAlerts = True: .
.Calculation = xlCalculationAutomatic: .ScreenUpdating = True
End With

If you have the time an suggests would help of course!!!!

Cheers.
Alex.:thumb:
 

PAB

Member
Hi Alex,

Basically what you have done is incorrect.
Let's go through it step by step.

(1) Basically, this is just dimensioning the variable DN4 as an Integer type. This has NO effect on the code unless the code actually uses the variable DN4 within it.

(2) By turning these OFF, this not only stops the screen from flickering while the code is running, but it substantially decreases the Run Time. It will NOT be noticeable on this particular program because it is small, but believe me, on larger programs you will definitely see the benefit.

(3a) Basically this is the start of the output range for the variable DN4.
(3b) Removing the variable DN4 from the Sum basically excludes whatever value DN4 would have represented at that particular time in the running process.
Plus, you have now got FIVE number combinations instead of SIX number combinations because you haven't replaced it with anything. That's what the gap(s) are.

(4a) This will obviously STOP anything being output in that particular position for the variable DN4.
(4b) This just formats the variable DN4 as a TWO DIGIT NUMBER.

(5) That is correct!

(6) This is the same as number (2) except it turns them back on and updates the screen with the information produced during Run Time.

I hope I have explained these to your understanding and satisfaction.
Please let me know if you want any further information.

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

PAB

Member
Hi Alex,

If you only want to have ONE DN number please let me know and I will put the code together for you.

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Alexafjb

Member
Good Morning PAB

Happy New to You, & Yours! :beer:

What I was doing with the Module was experimenting I figured it was compiled and would not give me the meat of the code, ( I.E. ATPVBAEN.XLS, SUMIF.XLAM, password locked, FUNCRES.XLAM,-for the "Calculate Combinations" (Button), I'm guessing.
Too bad though would have been nice to piece it all together. But alas proprietary information!

If you happen to revisit my last post and look close as to how I wrote it you will see the apostrophes. What I did was include the line of code to show where in the the module, I Remmed out the statement.
The logic I was using: was if it's not DIM'ed and no reference was made to it.... in this example "DN4" & I could fool the error checking then the Module would run and replace the "DN4" with any integer that would add up to the requested "Combination Sum Total". Ah it was a lark! didn't work, your programming is sound! no holes. Smiles, Never thought that I would find any!

As to your question:

If you only want to have ONE DN number please let me know and I will put the code together for you.

What I was looking for originally was the ability to use
1 DN,
1 + 2 DN,
1+2+3 DN and of course what you wrote 1+2+3+4 DN.

That was the other reason I started to mess with the module, you have put a lot of work into it, and I did not wish to come back to you and ask you to break it down, and lose a few more hairs over it! Plus I thought I would learn something, and I did!

Anyways, If you feel incline to then please & Thank You.

Cheers.
Alex. :thumb:
 

PAB

Member
Hi Alex,

Alexafjb said:
What I was doing with the Module was experimenting I figured it was compiled and would not give me the meat of the code, ( I.E. ATPVBAEN.XLS, SUMIF.XLAM, password locked, FUNCRES.XLAM,-for the "Calculate Combinations" (Button), I'm guessing.
Too bad though would have been nice to piece it all together. But alas proprietary information!
Don't quite follow you here, are you saying that to cannot look at or adapt the code???
The code does NOT use the ATPVBAEN.XLS, SUMIF.XLAM VBA Add-Ins and I have NOT Password Protected or Locked the code.
Confused, from the UK :confused: .

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Alexafjb

Member
Hi PAB

Don't quite follow you here, are you saying that to cannot look at or adapt the code???
The code does NOT use the ATPVBAEN.XLS, SUMIF.XLAM VBA Add-Ins and I have NOT Password Protected or Locked the code.

When observing in VBE, fresh Excel load no other excel programs loaded other then, Specific Sum Of Numbers + Prime.
The "Project Explore" window shows 1st in order...
+ ATPVBAEN.XLS
+ SUMIF.XLAM

When clicking on + to open the tree,
PASSWORD Dialog box opens to request Password.

When I downloaded the program from MediaFile I stored it and made 2 copies immediately before opening it. So, I've changed nothing.
Odd?

Can't look at the code in the above 2.

Cheers.
Alex.:confused:
 

PAB

Member
Hi Alex,

Alexafjb said:
When observing in VBE, fresh Excel load no other excel programs loaded other then, Specific Sum Of Numbers + Prime.
The "Project Explore" window shows 1st in order...
+ ATPVBAEN.XLS
+ SUMIF.XLAM

When clicking on + to open the tree,
PASSWORD Dialog box opens to request Password.

When I downloaded the program from MediaFile I stored it and made 2 copies immediately before opening it. So, I've changed nothing.
Odd?

Can't look at the code in the above 2.
They have NOTHING to do with or affect the program I wrote.
Does the program run correctly and give you the correct results for using FOUR DN numbers???

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Alexafjb

Member
Hi PAB

Yes it does run correctly.
I'm not concernd at the moment I'm sure in my studies I will find out why!

Cheers.
Alex.
 

PAB

Member
Hi Alex,

I have amended the code to include the TRUE Lexicographic Index Number, instead of the ACTUAL sorted combination numbers produced due to the criteria set.
Would you like me to post the amended code or do you want to have a go at it yourself first?
Either way suits me.

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Alexafjb

Member
Hi PAB

Funning thing! I was just working on that, and ran into a problem does not want to work if not combinations are present in the column output area i.e. I4...25 to N4...25.
I've Office Professional Plus 2007 and did not load all the help files. Wanted to look up the error I was in that process of reboot when your last post arrived, sorry for the delay!

Sure let me know how you want to do this, MediaFire or if you want to go direct just add hotmail.com to my full nick name on here, thats the public address, I think everyone in the world has it by now!

Cheers.
Alex. :spiny:
 

PAB

Member
Hi Alex,

Alexafjb said:
Funning thing! I was just working on that, and ran into a problem does not want to work if not combinations are present in the column output area i.e. I4...25 to N4...25.
Can you post the FULL code in your post for me to have a look at please, that way I can comment and give you feedback.
Then what I will do is post my amended code for you.
Thanks in advance.

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Alexafjb

Member
Hi PAB

I got it!!!

Using the formula from D.B. Mod you sent, I took column R4 to R33 and input. the origainal copy did not update the cell reference's correctly!

No problem that's fixed. Running teste now.

So question is, in your amendment, I bet the Lex is updated in the Object Module.

Cheers.
Alex.:look:
 

PAB

Member
Hi Alex,

Alexafjb said:
So question is, in your amendment, I bet the Lex is updated in the Object Module?
Yes it is.
Did you use the formula method in the actual WorkSheet itself?
Still post the code though for me to comment on and give you feedback.

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Alexafjb

Member
Not working in comparison.

Hi PAB

Here is the formula I tweaked from... "DataBase - Alex" you sent...

=COMBIN(E$2,6)-IF(E$2-5-I4>0,COMBIN(E$2-I4,6),0)-IF(E$2-4-J4>0,COMBIN(E$2-J4,5),0)-IF(E$2-3-K4>0,COMBIN(E$2-K4,4),0)-IF(E$2-2-L4>0,COMBIN(E$2-L4,3),0)-IF(E$2-1-M4>0,COMBIN(E$2-M4,2),0)-IF(E$2-N4>0,COMBIN(E$2-N4,1),0)

-I referenced cell E4 for 49 number (49,6)
-Updated the rest of the formula to reflect "combination output"
i.e. I4, J4, K4, L4, M4, N4 .
-Copy down column R4 to R33

Total Numbers Drawn = 49
DN1 = 10
DN2 = 11
DN3 = 15
DN4 = 49
Combination Sum Total = 135

CUT AND PAST DID NOT WORK IN THIS NOTE.

Compared the output to a Old BASIC Program by "Ion Saliu"
Called "Lexicographic Algorithms"

Not the same output for the 20 combinations?
Something is a miss!

Cheers.
Alex.:eek:
 

PAB

Member
Hi Alex,

Alexafjb said:
I referenced cell E4 for 49 number (49,6)
The cell reference should be cell E2.
So you added the formula method in the actual WorkSheet itself and NOT the code?

Alexafjb said:
Compared the output to a Old BASIC Program by "Ion Saliu" Called "Lexicographic Algorithms".
The less about that the better!

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Alexafjb

Member
Hi PAB

OK , then will amend.

By reading the past and Google searching (BTW, that's how I found this board!) I know there are a number of Names not to mention here! Hence the Quote, either here or in the other thread "can open up a HUGE can Of Ugly!"

Cheers.
Alex. :thumb:
 

PAB

Member
Hi Alex,

I have sent you an email.
Please let me know if you received it!

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Sidebar

Top