All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic
From ab to ba (Posted on 2019-01-17) Difficulty: 3 of 5
Given a string of 2 letters ab, your task is to convert it into ba. You are allowed to add either aa or bb on either side of a current string or into the string, like ab=>abaa=>abbb=>aaabbb=>aaabaabb.
You are also allowed to erase either aa or bb any place like aaabbb=>abbb.
Is it possible? If so, how?

No Solution Yet Submitted by Ady TZIDON    
Rating: 3.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution How to do it (spoiler) | Comment 1 of 2
No, it is not possible.  Here is a "parity"-type argument.

Let all of the a's equal zero and all of the b's equal one.  Calculate the "parity" as the sum of all the odd digits minus the sum of all the even digits.

Then ab = -1 and ba = 1.

But adding or erasing aa or bb  does not change the "parity".  Therefore, the desired transformation is impossible.

  Posted by Steve Herman on 2019-01-17 12:08:16
Please log in:
Remember me:
Sign up! | Forgot password

Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (5)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Copyright © 2002 - 2020 by Animus Pactum Consulting. All rights reserved. Privacy Information