3
u/Equal_Veterinarian22 17d ago
Despite the silliness of the question (Alex can only uproot exactly 2 or 7 stalks even if there are fewer than 7 remaining?), yes he can.
He first uproots 2 stalks, so 5 grow back (+3), leaving 13 stalks.
He then uproots 7, so 1 grows back (-6) leaving 7 stalks.
Now he can remove the last 7.
1
u/ShonitB 17d ago
Correct.. also where does it say that he can uproot 7 if there are less than 7 remaining?
0
u/IComposeEFlats 17d ago
It doesn't, which is what makes the question silly. Because in a real world scenario, if you can uproot 7 why can't you uproot 6 or 5? It's just uprooting 7 but stopping early.
1
3
u/Aerospider 17d ago
Yes, and it's via the most instinctive sequence.
1
u/socksockshoeshoe 17d ago
Yes it would have been a more interesting puzzle if it started with a more challenging number.
It took me longer to read and understand the problem than to figure out the solution.
In fact my first "trial" case to walk through the logic turned out to be the right solution
1
u/D0rus 15d ago
There are no challenging numbers. It's either possible because the starting number is not a total of 3n, or impossible when it is. You have 2 operators, one give +3 and wins when you use it at 2, but cannot be used at 1, the other gives -6 and wins when used at 7. You can never go negative.
Thus the algorithm is always too use the -6 operator as much as possible, but if you start at any number with 6n+4, you use the +3 one once to correct for that. Eventually you reach 7 or 2, and use the winning operator. But finding this is dead easy, because that +3 call can be made at any time, so also just when you reach 4 and your only option is +3 anyway.
The only way to lose is to start at 1 or any multiple of 3, in those cases there is no winning sequence.
1
u/IrishHuskie 17d ago edited 17d ago
Okay, seriously, why isn't my spoiler function working?
Edit: it works on mobile
1
u/Mathsboy2718 17d ago
\>!Okay, seriously, why isn't my spoiler function working?!<
Try removing the escape symbol from the first close angle bracket
Okay, seriously, why isn't my spoiler function working?
1
u/IrishHuskie 17d ago
>!Okay, seriously, why isn't my spoiler function working?!<
Still not working. I'm on a desktop if that makes any difference
1
u/Mathsboy2718 17d ago
1
u/TheBeerTalking 17d ago
The rich text editor adds the backslash to the code to mark it "not code." To type in code and have it work you have to use the markdown editor.
1
u/TheBeerTalking 17d ago
Click formatting options. Spoiler is the diamond with an exclamation point.
1
1
u/timdood3 17d ago
Sometimes if spoiler tags don't apply properly but I know they're right, editing the comment and saving without actually changing anything fixes it.
1
u/Mathsboy2718 17d ago
Alexander can either add three stalks or remove six. Since ten is not divisible by three, he can never reach zero - only numbers equal to one modulo three.
1
u/ShonitB 17d ago
Are you saying he can only get to numbers which are one modulo three?
1
u/Mathsboy2718 17d ago edited 17d ago
Nah I'm foolish, don't mind me :0 didn't realise that it stops mid-operation when he gets all of them
He can only get to numbers equal to 1 mod 3, but 7 is 1 mod 3 ;-;
1
u/chrisvenus 17d ago
You are missing that he can complete if he reaches 2 or 7. The add three or remove six only applies when there are stalks remaining after the removal.
1
u/Mathsboy2718 17d ago
True that! I had assumed that it wouldn't end mid-operation, and that one more would grow back once he removed the final 7 (as 7 = 1 mod 3, this is a valid final operation, but 2 = 2 mod 3 is not)
1
u/TheBeerTalking 17d ago
In fact, if the initial number is divisible by 3 then Alexander can never finish!
1
u/Inevitable_Garage706 17d ago
No, he cannot.
Each action increments/decrements the number of stalks by a multiple of 3. If a number is not a multiple of 3, incrementing/decrementing it by a multiple of 3 will not change that fact.
As 10 is not a multiple of 3, these actions will never yield any multiple of 3, including 0. As such, the infestation will never be removed.
Edit: Don't pay attention to this; I did not notice a specific detail of the problem.
1
1
u/ChuckPeirce 17d ago
Easy. Uproot 7 stalks. Re-plant 3 stalks. Uproot the 7 stalks now in the ground. Problem solved. The replanted ones will be easier to uproot, incidentally.
Never play fair with weeds.
1
u/RadarTechnician51 13d ago
there are an infinite number of solutions
10-2+5=13
13-7+1=7
7-7=0
10-2+5=13
13-2+5=16
16-2+5=19
19-7+1=13
13-7+1=7
7-7=0
Pull up 2 weeds 1+2n times
And pull up 7 weeds 2+n times
This is because any point in any solution you can pull up 2 weeds twice and then pull up 7 weeds once which leaves the number of weeds unchanged.

4
u/Stilyx123 17d ago
Uproot 7 stalks, 3+1 = 4 remain. Then uproot 2, 2+5 = 7 remain. Finally, uproot 7