I have five stacks of three blocks. I can join two stacks together, or split a stack.
How many splits and joins do I need to do to end up with three stacks of five blocks?

@christianp

4 joins 2 splits one way:
3 3 3 3 3
-> 6 3 3 3
-> 5 1 3 3 3
-> 5 4 3 3
-> 5 7 3
-> 5 5 2 3
-> 5 5 5

4 joins 2 splits another way:
3 3 3 3 3
-> 6 3 3 3
-> 9 3 3
-> 12 3
-> 15
-> 10 5
-> 5 5 5

4 joins 2 splits a third way:
3 3 3 3 3
-> 6 3 3 3
-> 5 1 3 3 3
-> 5 1 6 3
-> 5 1 5 1 3
-> 5 5 2 3
-> 5 5 5

don't have the time at the moment to generalize but i did not expect to get the same thing from three different approaches

Follow

That second one is perhaps the most telling.

Oh, but for A|B that "stack everything" is not optimal, of course. What about gcd(A,B)>1, so in the smallest interesting case 4,6? There you can get 4j2s, better than the stack-all 5j3s.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Mathstodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!