Find Recurrence Relation for Flipping n Switches

Click For Summary

Discussion Overview

The discussion revolves around finding a recurrence relation for flipping n switches in a specific configuration where the (i-1)th switch must be on to flip the ith switch, with all earlier switches off. The focus is on deriving the recurrence relation and understanding the implications of using such relations in mathematical contexts.

Discussion Character

  • Mathematical reasoning
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant proposes the recurrence relation f_n = f_{n-1} + 2 with the initial condition f_1 = 1, arguing that this reflects the necessary steps to turn on the nth switch while turning off the (n-1)th switch.
  • Another participant reiterates the same recurrence relation and reasoning, emphasizing the inability to turn off the (n-1)th switch directly.
  • A different participant questions the utility of recurrence relations compared to regular equations, suggesting that recurrence relations may be easier to derive in certain situations.
  • Further elaboration on the usefulness of recursion is provided, highlighting that recursive definitions can simplify problem-solving and are often more natural for certain constructions.
  • There is a remark on the distinction between recurrence and recursion, noting that recurrence is a specific case of recursion, which can involve more complex relationships.

Areas of Agreement / Disagreement

Participants generally agree on the proposed recurrence relation, but there is a broader discussion about the nature and utility of recurrence relations versus regular equations, indicating that multiple views on the topic exist.

Contextual Notes

The discussion includes assumptions about the flipping mechanism of switches and the implications of recursive definitions, but these assumptions are not fully explored or resolved.

find_the_fun
Messages
147
Reaction score
0
A circuit has n switches, all initially off. In order to be able to flip the ith switch, the (i-1)th switch must be on and all earlier switches off. The first switch can always be flipped. Find a recurrence relation for the total number of times the n switches must be flipped to get the nth switch on and all the others off.

I got [math]f_n=f_{n-1}+2[/math] with initial condition [math]f_1=1[/math] Is this right? This makes sense because to get the nth switch on, you need the (n-1)th switch on, and then you need to turn on the nth switch itself and turn off the (n-1)th switch. I have trouble explaining this using math though.
 
Last edited:
Physics news on Phys.org
Re: Finding a recurrence relation where (k-1)th switch must be on to turn on kth switch

find_the_fun said:
I got [math]f_n=f_{n-1}+2[/math] with initial condition [math]f_1=1[/math] Is this right? This makes sense because to get the nth switch on, you need the (n-1)th switch on, and then you need to turn on the nth switch itself and turn off the (n-1)th switch.
You can't turn off the $(n-1)$th switch by flipping it alone.
 
Re: Finding a recurrence relation where (k-1)th switch must be on to turn on kth switch

Speaking in general, what's the point of recurrence relations? Why not use a regular equation? Is it because in some situations it may be easier to derive/discover a recurrence relation?
 
Re: Finding a recurrence relation where (k-1)th switch must be on to turn on kth switch

find_the_fun said:
Is it because in some situations it may be easier to derive/discover a recurrence relation?
Yes. Recurrence relation is itself a function defined by recursion, i.e., the definition of such function refers to the function itself. And recurrence relation naturally accompany definitions by recursion, which may not even involve numbers (structural recursion). For example, it is easy to describe a recursive algorithm for solving Hanoi towers puzzle; a corresponding recurrence relation may count the required number of moves.

So, why is recursion useful?

(1) Recursive definitions are often simpler. For example, it is easy to come up with the recurrence relation for Fibonacci numbers from the description of the rabbit population growth, as in the original puzzle. Deriving Binet's formula is harder.

(2) Certain constructions of objects (numbers, lists, etc.) naturally lead to recursive definitions. Such constructions define how to build an object from existing ones: e.g., a list is either empty or a pair of a number and a list. Functions that take lists as arguments are often defined by recursion.

(3) The "divide-and-conquer" and dynamic programming techniques of building algorithms (e.g., binary search) use recursion to increase efficiency.

(4) Functions defined by recursion often can't be expressed using only operations from the definition. For example, the definition of factorial uses only 1 and multiplication, but the factorial is different from the four arithmetic operations. Concerning hailstone numbers, nobody knows if every starting number eventually turns into 1.

Remark: Some people make distinction between recurrence and recursion: the former is a special case of the latter. Since natural numbers can be considered built from 0 by using successor, a definition that gives f(n+1) from f(n) is a definition by recurrence, while the one that produces f(n) from f(n/2) uses more general recursion.
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 49 ·
2
Replies
49
Views
4K
  • · Replies 19 ·
Replies
19
Views
2K
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
21
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K