You have few calculator functions:

+ : add

- : subtract

* : mutiply

/ : divide

% : get remainders from divide

** : power

Notation:

1.f(x) = {1,2,3,4} means f(1)=1, f(2)=2, f(3)=3, f(4)=4.

2.cost = 1 means the function uses one operator.

So, please find all 24 functions of 4! with minimum of operations. That is,

f1(x)={1,2,3,4} f1(x)=x (cost = 0)

f2(x)={1,2,4,3} f2(x)=?

f3(x)={1,3,2,4} f3(x)=?

f4(x)={1,3,4,2} f4(x)=?

f5(x)={1,4,2,3} f5(x)=?

f6(x)={1,4,3,2} f6(x)=?

f7(x)={2,1,3,4} f7(x)=?

f8(x)={2,1,4,3} f8(x)=?

f9(x)={2,3,1,4} f9(x)=?

f10(x)={2,3,4,1} f10(x)=?

f11(x)={2,4,1,3} f11(x)=?

f12(x)={2,4,3,1} f12(x)=?

f13(x)={3,1,2,4} f13(x)=?

f14(x)={3,1,4,2} f14(x)=?

f15(x)={3,2,1,4} f15(x)=?

f16(x)={3,2,4,1} f16(x)=?

f17(x)={3,4,1,2} f17(x)=?

f18(x)={3,4,2,1} f18(x)=?

f19(x)={4,1,2,3} f19(x)=?

f20(x)={4,1,3,2} f20(x)=?

f21(x)={4,2,1,3} f21(x)=?

f22(x)={4,2,3,1} f22(x)=?

f23(x)={4,3,1,2} f23(x)=?

f24(x)={4,3,2,1} f24(x)=5-x (cost = 1)

Note:

1.it does not allow recursive function calls.

2.power operator costs 2 and others cost 1.

*3.divide operator gets the floor of the divide result. that is, 3/2 => 1

## Welcome to BrainDen.com - Brain Teasers Forum

Welcome to BrainDen.com - Brain Teasers Forum. Like most online communities you must register to post in our community, but don't worry this is a simple free process. To be a part of BrainDen Forums you may create a new account or sign in if you already have an account. As a member you could start new topics, reply to others, subscribe to topics/forums to get automatic updates, get your own profile and make new friends. Of course, you can also enjoy our collection of amazing optical illusions and cool math games. If you like our site, you may support us by simply clicking Google "+1" or Facebook "Like" buttons at the top. If you have a website, we would appreciate a little link to BrainDen. Thanks and enjoy the Den :-) |

Guest Message by DevFuse

# Find smallest function for 24 permutations

Started by Benson, Sep 27 2007 11:37 AM

2 replies to this topic

### #1

Posted 27 September 2007 - 11:37 AM

### #2

Posted 27 September 2007 - 12:38 PM

Cute puzzle. I think I have the idea.

Here's a start, more to come after I get some zzzzzzzzzzz's.

Here's a start, more to come after I get some zzzzzzzzzzz's.

Spoiler for ...

*The greatest challenge to any thinker is stating the problem in a way that will allow a solution.*

- Bertrand Russell

### #3

Posted 27 September 2007 - 05:02 PM

Great~ You solve the first 6 via "shift" and "make circle" them. You still need to use "*" or "/" to

"expand" and "compress" the distance for others.

"expand" and "compress" the distance for others.

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users