Generating a password by switching letters [closed]












1












$begingroup$


Stefan creates a password by switching his names's letters two by two,getting the password "fanest".How many switches did he make?

I don't know how to approach this,I simply tried making a few switches by hand,but I doubt this helps.

EDIT: After the discussion in the comments, I believe that we need to find the minimum number of moves and "two by two" means blocks of two letters.










share|cite|improve this question











$endgroup$



closed as off-topic by lioness99a, Riccardo.Alestra, Namaste, Lee David Chung Lin, Cesareo Jan 26 at 0:53


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Namaste, Lee David Chung Lin, Cesareo

If this question can be reworded to fit the rules in the help center, please edit the question.
















  • $begingroup$
    Does two by two mean that he switches blocks of two letters at a time? For example, $STeFAn to FAeSTn$ etc.
    $endgroup$
    – астон вілла олоф мэллбэрг
    Jan 25 at 13:37








  • 1




    $begingroup$
    The answer is simple. We can't know. After Stefan got to fanest he could in theory make a switch and then make the same switch (therefore going back to fanest with 2 more switches). He can repeat this as many times as he like and he will still end up getting fanest again.
    $endgroup$
    – Yanko
    Jan 25 at 13:41












  • $begingroup$
    @астонвіллаолофмэллбэрг the problem doesn't specify this,but I also think that it means he switches blocks of two letters(otherwise it wouldn't really make any sense to me at least)
    $endgroup$
    – Math Guy
    Jan 25 at 13:48












  • $begingroup$
    @Yanko I agree with you,but once he gets to fanest he stops switching.
    $endgroup$
    – Math Guy
    Jan 25 at 13:49






  • 2




    $begingroup$
    @MathGuy Same problem: he could go stefan -> tsefan -> stefan as many times as he liked before getting to fanest, for example. If we're aiming for the minimum number of switches needed, then stefan -> ftesan -> faestn -> fanste -> fanets -> fanest is five steps. Can there be a shorter one?
    $endgroup$
    – user3482749
    Jan 25 at 13:50


















1












$begingroup$


Stefan creates a password by switching his names's letters two by two,getting the password "fanest".How many switches did he make?

I don't know how to approach this,I simply tried making a few switches by hand,but I doubt this helps.

EDIT: After the discussion in the comments, I believe that we need to find the minimum number of moves and "two by two" means blocks of two letters.










share|cite|improve this question











$endgroup$



closed as off-topic by lioness99a, Riccardo.Alestra, Namaste, Lee David Chung Lin, Cesareo Jan 26 at 0:53


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Namaste, Lee David Chung Lin, Cesareo

If this question can be reworded to fit the rules in the help center, please edit the question.
















  • $begingroup$
    Does two by two mean that he switches blocks of two letters at a time? For example, $STeFAn to FAeSTn$ etc.
    $endgroup$
    – астон вілла олоф мэллбэрг
    Jan 25 at 13:37








  • 1




    $begingroup$
    The answer is simple. We can't know. After Stefan got to fanest he could in theory make a switch and then make the same switch (therefore going back to fanest with 2 more switches). He can repeat this as many times as he like and he will still end up getting fanest again.
    $endgroup$
    – Yanko
    Jan 25 at 13:41












  • $begingroup$
    @астонвіллаолофмэллбэрг the problem doesn't specify this,but I also think that it means he switches blocks of two letters(otherwise it wouldn't really make any sense to me at least)
    $endgroup$
    – Math Guy
    Jan 25 at 13:48












  • $begingroup$
    @Yanko I agree with you,but once he gets to fanest he stops switching.
    $endgroup$
    – Math Guy
    Jan 25 at 13:49






  • 2




    $begingroup$
    @MathGuy Same problem: he could go stefan -> tsefan -> stefan as many times as he liked before getting to fanest, for example. If we're aiming for the minimum number of switches needed, then stefan -> ftesan -> faestn -> fanste -> fanets -> fanest is five steps. Can there be a shorter one?
    $endgroup$
    – user3482749
    Jan 25 at 13:50
















1












1








1





$begingroup$


Stefan creates a password by switching his names's letters two by two,getting the password "fanest".How many switches did he make?

I don't know how to approach this,I simply tried making a few switches by hand,but I doubt this helps.

EDIT: After the discussion in the comments, I believe that we need to find the minimum number of moves and "two by two" means blocks of two letters.










share|cite|improve this question











$endgroup$




Stefan creates a password by switching his names's letters two by two,getting the password "fanest".How many switches did he make?

I don't know how to approach this,I simply tried making a few switches by hand,but I doubt this helps.

EDIT: After the discussion in the comments, I believe that we need to find the minimum number of moves and "two by two" means blocks of two letters.







combinatorics permutations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 25 at 14:12







Math Guy

















asked Jan 25 at 13:34









Math GuyMath Guy

576




576




closed as off-topic by lioness99a, Riccardo.Alestra, Namaste, Lee David Chung Lin, Cesareo Jan 26 at 0:53


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Namaste, Lee David Chung Lin, Cesareo

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by lioness99a, Riccardo.Alestra, Namaste, Lee David Chung Lin, Cesareo Jan 26 at 0:53


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Namaste, Lee David Chung Lin, Cesareo

If this question can be reworded to fit the rules in the help center, please edit the question.












  • $begingroup$
    Does two by two mean that he switches blocks of two letters at a time? For example, $STeFAn to FAeSTn$ etc.
    $endgroup$
    – астон вілла олоф мэллбэрг
    Jan 25 at 13:37








  • 1




    $begingroup$
    The answer is simple. We can't know. After Stefan got to fanest he could in theory make a switch and then make the same switch (therefore going back to fanest with 2 more switches). He can repeat this as many times as he like and he will still end up getting fanest again.
    $endgroup$
    – Yanko
    Jan 25 at 13:41












  • $begingroup$
    @астонвіллаолофмэллбэрг the problem doesn't specify this,but I also think that it means he switches blocks of two letters(otherwise it wouldn't really make any sense to me at least)
    $endgroup$
    – Math Guy
    Jan 25 at 13:48












  • $begingroup$
    @Yanko I agree with you,but once he gets to fanest he stops switching.
    $endgroup$
    – Math Guy
    Jan 25 at 13:49






  • 2




    $begingroup$
    @MathGuy Same problem: he could go stefan -> tsefan -> stefan as many times as he liked before getting to fanest, for example. If we're aiming for the minimum number of switches needed, then stefan -> ftesan -> faestn -> fanste -> fanets -> fanest is five steps. Can there be a shorter one?
    $endgroup$
    – user3482749
    Jan 25 at 13:50




















  • $begingroup$
    Does two by two mean that he switches blocks of two letters at a time? For example, $STeFAn to FAeSTn$ etc.
    $endgroup$
    – астон вілла олоф мэллбэрг
    Jan 25 at 13:37








  • 1




    $begingroup$
    The answer is simple. We can't know. After Stefan got to fanest he could in theory make a switch and then make the same switch (therefore going back to fanest with 2 more switches). He can repeat this as many times as he like and he will still end up getting fanest again.
    $endgroup$
    – Yanko
    Jan 25 at 13:41












  • $begingroup$
    @астонвіллаолофмэллбэрг the problem doesn't specify this,but I also think that it means he switches blocks of two letters(otherwise it wouldn't really make any sense to me at least)
    $endgroup$
    – Math Guy
    Jan 25 at 13:48












  • $begingroup$
    @Yanko I agree with you,but once he gets to fanest he stops switching.
    $endgroup$
    – Math Guy
    Jan 25 at 13:49






  • 2




    $begingroup$
    @MathGuy Same problem: he could go stefan -> tsefan -> stefan as many times as he liked before getting to fanest, for example. If we're aiming for the minimum number of switches needed, then stefan -> ftesan -> faestn -> fanste -> fanets -> fanest is five steps. Can there be a shorter one?
    $endgroup$
    – user3482749
    Jan 25 at 13:50


















$begingroup$
Does two by two mean that he switches blocks of two letters at a time? For example, $STeFAn to FAeSTn$ etc.
$endgroup$
– астон вілла олоф мэллбэрг
Jan 25 at 13:37






$begingroup$
Does two by two mean that he switches blocks of two letters at a time? For example, $STeFAn to FAeSTn$ etc.
$endgroup$
– астон вілла олоф мэллбэрг
Jan 25 at 13:37






1




1




$begingroup$
The answer is simple. We can't know. After Stefan got to fanest he could in theory make a switch and then make the same switch (therefore going back to fanest with 2 more switches). He can repeat this as many times as he like and he will still end up getting fanest again.
$endgroup$
– Yanko
Jan 25 at 13:41






$begingroup$
The answer is simple. We can't know. After Stefan got to fanest he could in theory make a switch and then make the same switch (therefore going back to fanest with 2 more switches). He can repeat this as many times as he like and he will still end up getting fanest again.
$endgroup$
– Yanko
Jan 25 at 13:41














$begingroup$
@астонвіллаолофмэллбэрг the problem doesn't specify this,but I also think that it means he switches blocks of two letters(otherwise it wouldn't really make any sense to me at least)
$endgroup$
– Math Guy
Jan 25 at 13:48






$begingroup$
@астонвіллаолофмэллбэрг the problem doesn't specify this,but I also think that it means he switches blocks of two letters(otherwise it wouldn't really make any sense to me at least)
$endgroup$
– Math Guy
Jan 25 at 13:48














$begingroup$
@Yanko I agree with you,but once he gets to fanest he stops switching.
$endgroup$
– Math Guy
Jan 25 at 13:49




$begingroup$
@Yanko I agree with you,but once he gets to fanest he stops switching.
$endgroup$
– Math Guy
Jan 25 at 13:49




2




2




$begingroup$
@MathGuy Same problem: he could go stefan -> tsefan -> stefan as many times as he liked before getting to fanest, for example. If we're aiming for the minimum number of switches needed, then stefan -> ftesan -> faestn -> fanste -> fanets -> fanest is five steps. Can there be a shorter one?
$endgroup$
– user3482749
Jan 25 at 13:50






$begingroup$
@MathGuy Same problem: he could go stefan -> tsefan -> stefan as many times as he liked before getting to fanest, for example. If we're aiming for the minimum number of switches needed, then stefan -> ftesan -> faestn -> fanste -> fanets -> fanest is five steps. Can there be a shorter one?
$endgroup$
– user3482749
Jan 25 at 13:50












1 Answer
1






active

oldest

votes


















2












$begingroup$

Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two blocks of two characters each produces $360$ distinct strings (half of the permutations of 'stefan'). The string 'fanest' is not among these strings.



Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two single characters produces $720$ distinct strings (all of the permutations of 'stefan'). These strings require at most $5$ swaps. The string 'fanest' is among those strings that require $5$ swaps.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Thank you very much ! I would have coded it myself if I weren't hopeless at programming. Here is another thing I have just observed : 'fanest' cannot be achieved from 'stefan' by swapping two blocks of two characters because 'n' is on an odd position and it would have to get to an even one,which is impossible since we swap chunks of two characters.
    $endgroup$
    – Math Guy
    Jan 25 at 22:10






  • 1




    $begingroup$
    @MathGuy Swapping 'te' with 'an' gives 'sanfte', with both 'a' and 'n' in target position. There is, however, as my answer suggests, some kind of parity with the block swaps.
    $endgroup$
    – Daniel Mathias
    Jan 25 at 22:27




















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2












$begingroup$

Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two blocks of two characters each produces $360$ distinct strings (half of the permutations of 'stefan'). The string 'fanest' is not among these strings.



Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two single characters produces $720$ distinct strings (all of the permutations of 'stefan'). These strings require at most $5$ swaps. The string 'fanest' is among those strings that require $5$ swaps.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Thank you very much ! I would have coded it myself if I weren't hopeless at programming. Here is another thing I have just observed : 'fanest' cannot be achieved from 'stefan' by swapping two blocks of two characters because 'n' is on an odd position and it would have to get to an even one,which is impossible since we swap chunks of two characters.
    $endgroup$
    – Math Guy
    Jan 25 at 22:10






  • 1




    $begingroup$
    @MathGuy Swapping 'te' with 'an' gives 'sanfte', with both 'a' and 'n' in target position. There is, however, as my answer suggests, some kind of parity with the block swaps.
    $endgroup$
    – Daniel Mathias
    Jan 25 at 22:27


















2












$begingroup$

Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two blocks of two characters each produces $360$ distinct strings (half of the permutations of 'stefan'). The string 'fanest' is not among these strings.



Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two single characters produces $720$ distinct strings (all of the permutations of 'stefan'). These strings require at most $5$ swaps. The string 'fanest' is among those strings that require $5$ swaps.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Thank you very much ! I would have coded it myself if I weren't hopeless at programming. Here is another thing I have just observed : 'fanest' cannot be achieved from 'stefan' by swapping two blocks of two characters because 'n' is on an odd position and it would have to get to an even one,which is impossible since we swap chunks of two characters.
    $endgroup$
    – Math Guy
    Jan 25 at 22:10






  • 1




    $begingroup$
    @MathGuy Swapping 'te' with 'an' gives 'sanfte', with both 'a' and 'n' in target position. There is, however, as my answer suggests, some kind of parity with the block swaps.
    $endgroup$
    – Daniel Mathias
    Jan 25 at 22:27
















2












2








2





$begingroup$

Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two blocks of two characters each produces $360$ distinct strings (half of the permutations of 'stefan'). The string 'fanest' is not among these strings.



Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two single characters produces $720$ distinct strings (all of the permutations of 'stefan'). These strings require at most $5$ swaps. The string 'fanest' is among those strings that require $5$ swaps.






share|cite|improve this answer









$endgroup$



Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two blocks of two characters each produces $360$ distinct strings (half of the permutations of 'stefan'). The string 'fanest' is not among these strings.



Programmatically generating the graph of all possible passwords achievable from 'stefan' by repeatedly swapping two single characters produces $720$ distinct strings (all of the permutations of 'stefan'). These strings require at most $5$ swaps. The string 'fanest' is among those strings that require $5$ swaps.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Jan 25 at 18:25









Daniel MathiasDaniel Mathias

1,36018




1,36018












  • $begingroup$
    Thank you very much ! I would have coded it myself if I weren't hopeless at programming. Here is another thing I have just observed : 'fanest' cannot be achieved from 'stefan' by swapping two blocks of two characters because 'n' is on an odd position and it would have to get to an even one,which is impossible since we swap chunks of two characters.
    $endgroup$
    – Math Guy
    Jan 25 at 22:10






  • 1




    $begingroup$
    @MathGuy Swapping 'te' with 'an' gives 'sanfte', with both 'a' and 'n' in target position. There is, however, as my answer suggests, some kind of parity with the block swaps.
    $endgroup$
    – Daniel Mathias
    Jan 25 at 22:27




















  • $begingroup$
    Thank you very much ! I would have coded it myself if I weren't hopeless at programming. Here is another thing I have just observed : 'fanest' cannot be achieved from 'stefan' by swapping two blocks of two characters because 'n' is on an odd position and it would have to get to an even one,which is impossible since we swap chunks of two characters.
    $endgroup$
    – Math Guy
    Jan 25 at 22:10






  • 1




    $begingroup$
    @MathGuy Swapping 'te' with 'an' gives 'sanfte', with both 'a' and 'n' in target position. There is, however, as my answer suggests, some kind of parity with the block swaps.
    $endgroup$
    – Daniel Mathias
    Jan 25 at 22:27


















$begingroup$
Thank you very much ! I would have coded it myself if I weren't hopeless at programming. Here is another thing I have just observed : 'fanest' cannot be achieved from 'stefan' by swapping two blocks of two characters because 'n' is on an odd position and it would have to get to an even one,which is impossible since we swap chunks of two characters.
$endgroup$
– Math Guy
Jan 25 at 22:10




$begingroup$
Thank you very much ! I would have coded it myself if I weren't hopeless at programming. Here is another thing I have just observed : 'fanest' cannot be achieved from 'stefan' by swapping two blocks of two characters because 'n' is on an odd position and it would have to get to an even one,which is impossible since we swap chunks of two characters.
$endgroup$
– Math Guy
Jan 25 at 22:10




1




1




$begingroup$
@MathGuy Swapping 'te' with 'an' gives 'sanfte', with both 'a' and 'n' in target position. There is, however, as my answer suggests, some kind of parity with the block swaps.
$endgroup$
– Daniel Mathias
Jan 25 at 22:27






$begingroup$
@MathGuy Swapping 'te' with 'an' gives 'sanfte', with both 'a' and 'n' in target position. There is, however, as my answer suggests, some kind of parity with the block swaps.
$endgroup$
– Daniel Mathias
Jan 25 at 22:27





Popular posts from this blog

'app-layout' is not a known element: how to share Component with different Modules

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

WPF add header to Image with URL pettitions [duplicate]