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

How many ternary strings of length six do not contain two consecutive0'sor twoconsecutive1's?

Short Answer

Expert verified

There are 239 ternary strings of length six that do not contain two consecutive 0'sor two consecutive 1's.

Step by step solution

01

Given data

A string that contains only 0's, 1'sand 2'sis called a ternary string.

02

Concept used of recurrence relation 

A recurrence relation is an equation that recursively defines a sequence where the next term is a function of the previous terms (Expressing Fnas some combination of Fi with i<n).

03

Find the number of ternary strings

We will compute a2 through a6 using the recurrence relation:

a2=a1+2a0+2=3+2·1+2=7a3=a2+2a1+2a0+2=7+2·3+2·1+2=17a4=a3+2a2+2a1+2a0+2=17+2·7+2·3+2·1+2=41a5=a4+2a3+2a2+2a1+2a0+2=41+2·17+2·7+2·3+2·1+2=99a6=a5+2a4+2a3+2a2+2a1+2a0+2=99+2·41+2·17+2·7+2·3+2·1+2=239

Thus there are 239 ternary strings of length 6 that do not contain two consecutive 0'sor two consecutive 1's.

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