Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Devise an algorithm for generating all the r-permutations of a finite set when repetition is allowed.

Short Answer

Expert verified

Device an algorithm for generating all the \(r - \)permutation of a finite set when repetition is allowed.

Step by step solution

01

Step 1:

\({a_1},{a_2},.............,{a_n}\)and each\({a_i} < n\)

\(i = r\)

When\({r_i} = n\)

\(\left\{ \begin{array}{l}{a_i} = 1\\i:i - 1\end{array} \right\}\)

\(\left\{ {{a_i} = {a_i} + 1} \right\}\)

02

Step 2:

Given:

Repetition is allowed.

Concept used.

\(r\)Permutation of n element when repetition is allowed\({n_{{p_r}}} = \frac{{n!}}{{r!}}\)

Calculation:

\({a_1},{a_2},{a_3}.............,{a_n}\) be positive integer, \({a_i} < n\) procedure

\(i = r\)

While\({a_i} = n\)

\(\begin{array}{l}{a_i} = 1\\i:i - 1\end{array}\)

So, the result will be

\({a_1},{a_2},.............,{a_r}\) Is the next permutation in lexicographic order.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free