All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
A permutation puzzle (Posted on 2006-09-20) Difficulty: 3 of 5
Determine the number of permutations (p1, p2,...p7) of 1,2, ...7; such that for all k 1≤k≤6, (p1, p2,... pk) is not a permutation of (1,2, ...k); i.e., p1≠1; (p1, p2) is not a permutation of (1,2), etc.

What would be the answer if we specify 1≤k<6 instead?

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 5 of 6 |
a=[1 2 3 4 5 6 7]
p=perms(a); count=0;
for r=1:size(p)
  p0=p(r,:);  good=true;
  for k=1:6
       pk=p0(1:k);
       pt=a(1:k);
       if pt==sort(pk)
           good=false;
           break
       end
  end
  if good 
      
      count= count+1;
  end
end
count



count =
        3447


Part 2:

If instead we use
  for k=1:5

we get 

count =
        3908

  Posted by Charlie on 2020-11-24 12:44:13
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (15)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information