# Rearranging Frogs [duplicate]

This is a small puzzle that I saw a lot as a kid but surprisingly haven't found on this site. Enjoy!

You have six frogs arranged on seven lily pads in a line: three male frogs facing right on the leftmost lily pads and three female frogs facing left on the rightmost lily pads.

M M M _ F F F

How can you switch the positions of the frogs (have the male frogs end up where the female frogs currently sit and vice versa)?

Rules:

• Each lily pad can hold only one frog.
• Frogs can only move in the direction they are facing.
• Frogs can move forward to an empty lily pad or jump over one frog to the empty lily pad on the other side.
• @JonTheMon There's the duplicate I was looking for. The wording of that one was very poor, though... Commented Jul 10, 2015 at 17:14
• Also once you have the idea, 5 on each side is a bit more of a grind problem. Commented Jul 10, 2015 at 17:17
• Is it really a duplicate? In the other question only one merchant's camels can jump, but here frogs from each side can jump. Commented Jul 10, 2015 at 20:58
• It's essentially the same question, but I'm just surprised the camels can jump at all :P Commented Jul 10, 2015 at 21:13

Basic idea:

They need to try to mix perfectly - MFMFMF

Process:

MMM_FFF
MM_MFFF
MMFM_FF
MMFMF_F
MMF_FMF
M_FMFMF
_MFMFMF
FM_MFMF
FMFM_MF
FMFMFM_
FMFMF_M
FMF_FMM
F_FMFMM
FF_MFMM
FFFM_MM
FFF_MMM

Also, I'm also surprised this isn't on the site already in a different form. It's quite possible that I just didn't search for the right terms.

• Out of the three answers there's a 17 move, 16 move, and 15 move. I think yours is the most efficient possible (and first before going's edit) so +1 and probably should be accepted. Commented Jul 10, 2015 at 17:07
• @Quark you mean 2 15s and a 17
– JLee
Commented Jul 10, 2015 at 17:13
• @JLee the other 15 had duplicated a line, making it look like a 16. Commented Jul 10, 2015 at 17:15
• Woopsie daisies... Commented Jul 10, 2015 at 17:16

MMM_FFF
MMMF_FF
MM_FMFF
M_MFMFF
MFM_MFF
MFMFM_F
MFMFMF_
MFMF_FM
MF_FMFM
_FMFMFM
F_MFMFM
FFM_MFM
FFMFM_M
FFMF_MM
FF_FMMM
FFF_MMM !

• Nice job. This looks optimal.
– JLee
Commented Jul 10, 2015 at 17:12
• Honestly I am fairly certain there could only ever be 1 way to do this as how in I am approaching it you are forced as if you go one move rather than another it always cuts off the other move. Commented Jul 10, 2015 at 17:16