필터 지우기
필터 지우기

special case of permutation combination with same sequence

조회 수: 1 (최근 30일)
Vishal Sharma
Vishal Sharma 2017년 1월 30일
답변: Guillaume 2017년 1월 30일
I have a problem of special case of permutation combination From nos from 1 to 30 .
Supposing a permutation combination from vector 1 to 30 is to be formulated Condition is sequence of previous solution should remain same
Supposing we have reached at 3rd step Where we have 4 5 6 numbers selected and we have to select forth number from remaining set numbers, i.e. from 1 – 3 and 7 – 30, so permutation combinations should be such that sequence of previous numbers 4 5 6 should remain same, so the result should be
1 4 5 6
2 4 5 6
3 4 5 6
7 4 5 6
4 1 5 6
......
and so on When we have four digit selected say (e.g.) 4 9 5 6 Next time permutation combinations are to be formulated for fifth digit from remaining set of numbers in the same sequence of 4 9 5 6
Thanks and Regards
  댓글 수: 2
Stephen23
Stephen23 2017년 1월 30일
@Vishal Sharma: What exactly is your question? Or are you just looking for someone to do your homework for you? You do not seem to have put any effort into this at all.
Adam
Adam 2017년 1월 30일
You need to give a clearer full example of what you are aiming for. I don't see any obvious logic behind the 'result' that you say should happen, other than that initially it just has 4 5 6 repeated after each number until some point and then it just appears arbitrary.
Permutations and combinations are two distinct things though so saying permutation combinations is confusing.

댓글을 달려면 로그인하십시오.

답변 (1개)

Guillaume
Guillaume 2017년 1월 30일
What you want is not clear. Possibly, it is this:
fullset = 1:30;
currentset = [4 5 6];
setperms = arrayfun(@(n) perms([n, currentset]), setdiff(fullset, currentset), 'UniformOutput', false);
setperms = vertcat(setperms{:})

카테고리

Help CenterFile Exchange에서 Discrete Math에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by