D(n) is the number of ways the set {1,2,3,…,n} can be partitioned into two sets. D(n-1) is the number of ways the set {1,2,3,…,n-1} can be partitioned into two sets. n-1 can be divided into two sets, say, A and B. Now we add element n into A and B.

gemuntertjx

gemuntertjx

Answered question

2022-09-06

This is my work so far:
- D(n) is the number of ways the set {1,2,3,…,n} can be partitioned into two sets.- D ( n 1 ) is the number of ways the set { 1 , 2 , 3 , , n 1 } can be partitioned into two sets.
n 1 can be divided into two sets, say, A and B. Now we add element n into A and B.
Now each partition of D ( n 1 ) gives two partitions of D(n):
- D ( n ) = 2 D ( n 1 )
To solve:
let D ( n ) = r n
r n = 2 r n 1
r = 2
D ( n ) = 2 R n
Is my logic correct?

Answer & Explanation

Cameron Benitez

Cameron Benitez

Beginner2022-09-07Added 17 answers

Step 1
This is not solved by way of a recurrence relation, but here it is anyway.
There are ( n 1 ) ways to separate out a one element partition.
There are ( n 2 ) ways to separate out a two element partition.
Step 2
We know that
k = 0 n ( n k ) = 2 n
but we want half of
k = 1 n 1 ( n k ) = 2 n 2
so D ( n ) = 2 n 1 1
Step 3
Once we see the equation for D(n) we easily see that
D ( n + 1 ) = 2 D ( n ) + 1
so we have the recurrence relation.
Manuel Leach

Manuel Leach

Beginner2022-09-08Added 13 answers

Step 1
The recurrence will be
D ( n ) = 2 D ( n 1 ) + 1
because inside each of the D ( n 1 ) ways we can add the n t h element in one of the two sets (inside each way) + one way containing {1,2,.......,n-1},{n}. The base case will be
D ( 2 ) = 1
D ( 2 ) = 1
Step 2
On Solving this recurrence
D ( n ) = 2 ( 2 D ( n 2 ) + 1 ) + 1 = 2 2 D ( n 2 ) + 2 + 1 = 2 3 D ( n 3 ) + 2 2 + 2 1 + 2 0
Generalizing thus:
D ( n ) = 2 k D ( n k ) + 2 k 1 + 2 k 2 + . . . . . . . . . . . + 2 1 + 2 0
put k = n 2, we get:
D ( n ) = 2 n 2 D ( 2 ) + 2 n 3 + 2 n 4 + . . . . . . . . + 2 + 1
D ( n ) = 2 n 2 + . . . . . . . + 2 + 1
(Geometric progression) D ( n ) = 2 n 1 1 2 1
D ( n ) = 2 n 1 1

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?