Find the next larger permutation in lexicographic order after each of thesed) 31528764

permutations.

a) 1342

b) 13245

c) 1623547

Printable View

- November 30th 2008, 03:44 PMdh214LEXICOGRAPHIC ORDER OF PERMUTATIONSFind the next larger permutation in lexicographic order after each of thesed) 31528764

permutations.

a) 1342

b) 13245

c) 1623547

- November 30th 2008, 08:36 PMSoroban
Hello, dh214!

Could you explain the problem, please?

Quote:

Find the next larger permutation in*lexicographic order*??

after each of these permutations.

a) 1342

b) 13245

c) 1623547

d) 31528764

"Lexicographic" means "like a dictionary."

It sounds like we write out all the possible permutations**in words**,

. . then list them in alphabetical order.

This is perhaps the silliest "math" problem ever!

- November 30th 2008, 11:20 PMMoo
That's because you don't know how it is applied to mathematics :p

Lexicographical order - Wikipedia, the free encyclopedia

Okay, here is what to do, for the first one.

There are 4 digits : {1,2,3,4}

You're asked for the one following 1342.

Since these are permutations, you have to change at least 2 digits.

So let's start with the last 2 digits. If you permutate them, you get 1324. But following the lexicographical order, this is not larger than 1342.

So you'll have to change the 2nd digit. What comes right after 3 in the list ? 4.

So it'll start with 14..

there are 2 and 3 remained to be sitted :P Since 2<3, it'll be**1423**.

For c) :

1623547

what if you permutate the last 2 digits ?

It'll give 1623574, and obviously, it is larger. You're done.

etc, etc...