Find all the permutations given some finite characters

AI Thread Summary
Finding permutations of a set of characters can be straightforward on paper but challenging in programming due to the need for a clear algorithm. The discussion highlights that while individuals may intuitively grasp the concept of permutations, translating that understanding into code requires structured thinking and the ability to articulate the process clearly. Key methods include using recursion and understanding operations like swapping and rotating characters. It emphasizes the importance of developing a step-by-step approach that can be communicated effectively, as computers require precise instructions to execute tasks. The conversation also raises questions about one's programming proficiency and the ability to describe the permutation process in clear terms, suggesting that a deeper understanding of both the concept and coding is necessary for successful implementation.
jd12345
Messages
251
Reaction score
2
Well I am coming across problems like finding permutation of some n characters. On paper I can find all the permutations given some finite characters easily but when it comes to programming it is hard, why? Why is it hard to tell a computer what I myself can do it so easily?
This is strange - I mean I can do it myself so easily but I can't code it. Does this mean that I myself don't understand it?
 
Technology news on Phys.org


The issue is that you need an algorithm to do the permuations in some specific order, without duplicates. A recursive method may be useful here. You could to a web search for "permuting an array", and find examples of code that does this, or you could grind it out. The two main operations are swapping and rotating of the characters.
 


doing it without thinking is not quite enough, is it?

You need to do it once or twice and develop a set of steps, instructions that work every time and writ them down as if you were to give them to somebody else who does not how to do such thing and they should be able to follow your instructions and do it...

...then, you can give them to a computer...after all, computers are very stupid...they just do what you tell them to do!
 


if i cannot explain it to someone then how am i able to do it ?
 
jd12345 said:
Well I am coming across problems like finding permutation of some n characters. On paper I can find all the permutations given some finite characters easily but when it comes to programming it is hard, why? Why is it hard to tell a computer what I myself can do it so easily?
This is strange - I mean I can do it myself so easily but I can't code it. Does this mean that I myself don't understand it?
Maybe...

Are you sure you can do it yourself? For how long a string have you tried to find all the permutations of? How do you know you've successfully found all permutations?

How well do you know how to program? If you don't know how to program sufficiently well then obviously you won't necessarily be able to program what you know how to do...

Can you even describe in English how to enumerate over all permutations?
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top