Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 84031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:52:01+00:00 2026-05-10T21:52:01+00:00

Suppose we have n elements, a 1 , a 2 , …, a n

  • 0

Suppose we have n elements, a1, a2, …, an, arranged in a circle. That is, a2 is between a1 and a3, a3 is between a2 and a4, an is between an-1 and a1, and so forth.

Each element can take the value of either 1 or 0. Two arrangements are different if there are corresponding ai‘s whose values differ. For instance, when n=3, (1, 0, 0) and (0, 1, 0) are different arrangements, even though they may be isomorphic under rotation or reflection.

Because there are n elements, each of which can take two values, the total number of arrangements is 2n.

Here is the question:

How many arrangements are possible, such that no two adjacent elements both have the value 1? If it helps, only consider cases where n>3.

I ask here for several reasons:

  1. This arose while I was solving a programming problem
  2. It sounds like the problem may benefit from Boolean logic/bit arithmetic
  3. Maybe there is no closed solution.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:52:01+00:00Added an answer on May 10, 2026 at 9:52 pm

    Let’s first ask the question ‘how many 0-1 sequences of length n are there with no two consecutive 1s?’ Let the answer be A(n). We have A(0)=1 (the empty sequence), A(1) = 2 (‘0’ and ‘1’), and A(2)=3 (’00’, ’01’ and ’10’ but not ’11’).

    To make it easier to write a recurrence, we’ll compute A(n) as the sum of two numbers:
    B(n), the number of such sequences that end with a 0, and
    C(n), the number of such sequences that end with a 1.

    Then B(n) = A(n-1) (take any such sequence of length n-1, and append a 0)
    and C(n) = B(n-1) (because if you have a 1 at position n, you must have a 0 at n-1.)
    This gives A(n) = B(n) + C(n) = A(n-1) + B(n-1) = A(n-1) + A(n-2). By now it should be familiar 🙂

    A(n) is simply the Fibonacci number Fn+2 where the Fibonacci sequence is defined by
    F0=0, F1=1, and Fn+2= Fn+1+Fn for n ≥ 0.

    Now for your question. We’ll count the number of arrangements with a1=0 and a1=1 separately. For the former, a2 … an can be any sequence at all (with no consecutive 1s), so the number is A(n-1)=Fn+1. For the latter, we must have a2=0, and then a3…an is any sequence with no consecutive 1s that ends with a 0, i.e. B(n-2)=A(n-3)=Fn-1.

    So the answer is Fn+1 + Fn-1.

    Actually, we can go even further than that answer. Note that if you call the answer as
    G(n)=F
    n+1+Fn-1, then
    G(n+1)=Fn+2+Fn, and
    G(n+2)=Fn+3+Fn+1, so even G(n) satisfies the same recurrence as the Fibonacci sequence! [Actually, any linear combination of Fibonacci-like sequences will satisfy the same recurrence, so it’s not all that surprising.] So another way to compute the answers would be using:
    G(2)=3
    G(3)=4
    G(n)=G(n-1)+G(n-2) for n≥4.

    And now you can also use the closed form Fn=(αn-βn)/(α-β) (where α and β are (1±√5)/2, the roots of x2-x-1=0), to get
    G(n) = ((1+√5)/2)n + ((1-√5)/2)n.
    [You can ignore the second term because it’s very close to 0 for large n, in fact G(n) is the closest integer to ((1+√5)/2)n for all n≥2.]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose, in MATLAB, that I have a matrix, A, whose elements are either 0
Suppose I have an array that mimics a database table. Each array element represents
Suppose I have an element called #container-main . How do I make that display:none
Suppose you have WPF Window composed of many elements that are using DataTemplates /
Suppose I have a task that is pulling elements from a java.util.concurrent.BlockingQueue and processing
suppose I have arraylist of integers...is there a way that I can generate a
Suppose I have a list, called elements , each of which does or does
Suppose you have a List<Elements> in memory and a List<Files> , each of which
Suppose I have 2 enumerations that I know have the same number of elements
Suppose I have an element (in my case, a StackPanel ) that contains several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.