We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
Can't work out the forumula for this (SOLVED)
Comments
-
[Deleted User] said:MeteredOut said:[Deleted User] said:TryingToWork said:Hi, please can someone tell me the formula for working out how to get every possible combination* of all the following 12 letters?
* (They don't need to be swapped within their own section. The order within each section does not matter. So in the LEFT section S does not need to be swapped with i, for example. Only need them swapped from different sections).
I started doing it manually (by swapping two letters from each section to another section, and putting them back, and swapping two more) but then I realised there are a LOT more combinations that I thought. I now realise there could be hundreds!
But how do I find out all of them?
I'm not mathematically minded at all. Got a D in Maths GCSE.
Thanks a lot
For anyone with any basic comprehension skills, Its's clear the AI you referred to did not even understand the question, never-mind getting anywhere close to providing something that would help progress with a solution.
I question why you post a link to something that clearly does not help in any way and added "hope it helps".
You've posted a few links to that AI today - are you connected to it in some way? Based on this one example here, it seems well behind ChatGPT.2 -
MeteredOut said:[Deleted User] said:MeteredOut said:[Deleted User] said:TryingToWork said:Hi, please can someone tell me the formula for working out how to get every possible combination* of all the following 12 letters?
* (They don't need to be swapped within their own section. The order within each section does not matter. So in the LEFT section S does not need to be swapped with i, for example. Only need them swapped from different sections).
I started doing it manually (by swapping two letters from each section to another section, and putting them back, and swapping two more) but then I realised there are a LOT more combinations that I thought. I now realise there could be hundreds!
But how do I find out all of them?
I'm not mathematically minded at all. Got a D in Maths GCSE.
Thanks a lot
For anyone with any basic comprehension skills, Its's clear the AI you referred to did not even understand the question, never-mind getting anywhere close to providing something that would help progress with a solution.
I question why you post a link to something that clearly does not help in any way and added "hope it helps".
You've posted a few links to that AI today - are you connected to it in some way? Based on this one example here, it seems well behind ChatGPT.You could ask the machine to explain points that you find challenging. One thing that greatly assists code is if it has comments so I asked the machine to comment the code and then ran it as an Excel 16 macro. It produced the following output. I use Windows Copilot to double check Perplexity and vica-versa. Copilot does not allow its output to be shared in the manner that Perplexity does.01. ABCDEFGHIJKLMNOP
02. ABCDEFGHMNOPIJKL
03. ABCDIJKLEFGHMNOP
04. ABCDIJKLMNOPEFGH
05. ABCDMNOPEFGHIJKL
06. ABCDMNOPIJKLEFGH
07. EFGHABCDIJKLMNOP
08. EFGHABCDMNOPIJKL
09. EFGHIJKLABCDMNOP
10. EFGHIJKLMNOPABCD
11. EFGHMNOPABCDIJKL
12. EFGHMNOPIJKLABCD
13. IJKLABCDEFGHMNOP
14. IJKLABCDMNOPEFGH
15. IJKLEFGHABCDMNOP
16. IJKLEFGHMNOPABCD
17. IJKLMNOPABCDEFGH
18. IJKLMNOPEFGHABCD
19. MNOPABCDEFGHIJKL
20. MNOPABCDIJKLEFGH
21. MNOPEFGHABCDIJKL
22. MNOPEFGHIJKLABCD
23. MNOPIJKLABCDEFGH
24. MNOPIJKLEFGHABCD0 -
That solution above still does not come anywhere close to solving the OP's challenge. It shows a complete lack of understanding of the question.
As an AI engine, that is a huge failure.2 -
TryingToWork said:MeteredOut said:TryingToWork As to your question - you can get a formula to give you the number of permutations, but you won't get a formula to give you those permutations.
For that, you'll need to drop into code, probably using recursion. ChatGPT could probably give you a head start.
Thank you both. I appreciate your help.
Yes I think I need code. But how do I word it to tell Chat GPT to do what you said?
Thanks a lotGoogle Gemini is more language orientated and not very good at coding. All the Perplexity stuff posted is not subscription Pro stuff where clarifying questions are asked of the user. Anyway, as I previously said I use Copilot to double check Perpexity output. So I asked it if it understood the OP posting. This is what it said:[1]: https://forums.moneysavingexpert.com/discussion/6505595/cant-work-out-the-forumula-for-this ""
[2]: https://forums.moneysavingexpert.com/discussion/6505595/cant-work-out-the-forumula-for-this/p2 ""
Yes, I understand. The original poster (OP) on the forum is trying to find a formula or method to generate all possible combinations of a set of 12 letters¹[1]. They specify that the order within each section does not matter and the letters do not need to be swapped within their own section¹[1].
However, in a later post, the OP clarified that if the sections made the whole thing too complicated, they were willing to settle for mixing up all 12 letters without the sections²[2].
A user on the forum provided a solution in both JavaScript and Python for generating all permutations of a given string²[2]. However, this solution generates all permutations of the string, not just the combinations, and it doesn't take into account the OP's original requirement about sections²[2].
The OP seems to be trying to solve a puzzle similar to the New York Times' Letterboxed game, but in a hexagonal version²[2]. They are looking for a way to generate solution words for the puzzle²[2].
Please note that generating all combinations or permutations of a set of 12 letters can result in a very large number of results, which may be impractical to compute or display²[2].
Source: Conversation with Bing, 29/04/2024
(1) Can't work out the forumula for this - MoneySavingExpert Forum. https://forums.moneysavingexpert.com/discussion/6505595/cant-work-out-the-forumula-for-this.
(2) Can't work out the forumula for this - MoneySavingExpert Forum. https://forums.moneysavingexpert.com/discussion/6505595/cant-work-out-the-forumula-for-this/p2.Next I asked it to code a solution:Sure, I can provide a simple VBA solution to generate all possible combinations of a set of 12 letters. This solution doesn't take into account the sections mentioned by the OP in the forum post, but it should give you a good starting point.
Here's a simple VBA function that generates all combinations of a given string:
```vba
Sub GenerateCombinations()
Dim letters As String
Dim i As Long
Dim j As Long
' Define the set of 12 letters
letters = "ABCDEFGHIJKL"
' Loop through each character in the string
For i = 1 To Len(letters)
' Generate all combinations starting with the i-th character
For j = i To Len(letters)
Debug.Print Mid(letters, i, j - i + 1)
Next j
Next i
End Sub
```
This code defines a string `letters` containing 12 characters. It then loops through each character in the string, and for each character, it generates all combinations of characters starting with that character. The combinations are printed to the Immediate window in the VBA editor.
Please note that this code generates combinations, not permutations, and it doesn't take into account the sections mentioned by the OP in the forum post. If you need to generate permutations or take into account the sections, the code would be more complex. Also, generating all combinations of a set of 12 letters can result in a very large number of results, which may be impractical to compute or display.
You can run this code in the VBA editor in any Microsoft Office application, such as Excel or Word. To open the VBA editor, press `Alt + F11`. To run the code, press `F5` while the cursor is inside the `GenerateCombinations` subroutine. To view the output, open the Immediate window by pressing `Ctrl + G`.
I hope this helps! Let me know if you have any other questions.The code produced the following output but not sure if this is what you want. It ran out of steam in the end:A
AB
ABC
ABCD
ABCDE
ABCDEF
ABCDEFG
ABCDEFGH
ABCDEFGHI
ABCDEFGHIJ
ABCDEFGHIJK
ABCDEFGHIJKL
B
BC
BCD
BCDE
BCDEF
BCDEFG
BCDEFGH
BCDEFGHI
BCDEFGHIJ
BCDEFGHIJK
BCDEFGHIJKL
C
CD
CDE
CDEF
CDEFG
CDEFGH
CDEFGHI
CDEFGHIJ
CDEFGHIJK
CDEFGHIJKL
D
DE
DEF
DEFG
DEFGH
DEFGHI
DEFGHIJ
DEFGHIJK
DEFGHIJKL
E
EF
EFG
EFGH
EFGHI
EFGHIJ
EFGHIJK
EFGHIJKL
F
FG
FGH
FGHI
FGHIJ
FGHIJK
FGHIJKL
G
GH
GHI
GHIJ
GHIJK
GHIJKL
H
HI
HIJ
HIJK
HIJKL
I
IJ
IJK
IJKL
J
JK
JKL
K
KL
L1 -
I make it 12!(4!)^(-4) = 1444
I looked at it this afternoon and was put off by the constraint that you can't swap letters within a group, but it doesn't actually make much difference; you just get 12 instead of 15.
I'm assuming that it was intended that all letters be swapped out of their original group. If you want to count all configurations that can be reached through any number of pair exchanges between the groups that is, I think:
16!(4!)^(-4) = 63,063,000
1 -
bob2302 said:I make it 12!(3!)^(-4) = 369,600
I looked at it this afternoon and was put off by the constraint that you can't swap letters within a group, but it doesn't actually make much difference; you just get 12 instead of 15.
I'm assuming that it was intended that all letters be swapped out of their original group. If you want to count all configurations that can be reached through any number of pair exchanges between the groups that is, I think:
16!(3!)^(-4) = 16,144,128,000
0 -
OP has not logged in for 3 weeks. Unlikely.3
-
TryingToWork said:
I work them out the slow way currently, but because I am building an app of the puzzles and the app learning is time consuming, I need a script to help me with the word combinations.
As a side note, Wordle uses a list of 5 letter words for each day's puzzle, but be wary if you use it as it goes in sequence so once you know where yesterday's word is it's trivial to find today's [and ongoing]. It also uses another list of acceptable 5 letter words to match against each guess, so if you're limiting puzzles to 5 letters you could borrow that.1 -
I have stated this as SOLVED, as I no longer need reponses. But in reality I gave up trying, as I found it was impossible, as stated on page 2. Apologies to the kind people who continued responding. I don't get emails from this forum for some reason, even though I subscribe to my own posts. I now create different puzzles, so this is not needed. Thank you to all who helped.0
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 349.9K Banking & Borrowing
- 252.6K Reduce Debt & Boost Income
- 453K Spending & Discounts
- 242.8K Work, Benefits & Business
- 619.6K Mortgages, Homes & Bills
- 176.4K Life & Family
- 255.7K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 15.1K Coronavirus Support Boards