# "Peel away and Guess" and Python

• Python
• Stephen Tashi
In summary, during a conversation on how to find the closed form of a recursive LTI system, a suggestion was made to add a link to notes explaining the "peel away and guess method." However, the person making the suggestion was unsure if they would be able to understand it and also mentioned not being a Python programmer. The discrepancy between the function defined and the code used was also discussed, with the suggestion that it may be a typo. The mysterious term "x[n]" was brought up, with reference to it being treated as an input in the notes. This conversation took place on a thread where the OP had not yet received a solution.
Stephen Tashi
I sent a PM to member kostoglotov suggesting he add a link to some notes containing the problem posed in his thread (https://www.physicsforums.com/threads/finding-the-closed-form-of-a-recursive-lti-system.900342/ ).

The "peel away and guess method" explained in those notes looks interesting, but it's new to me and I don't know if I'll figure it out - also I'm not a Python programmer.

I didn't post my suggestion in the thread itself because I want the thread to still show up as unanswered.

He defines his function as $y[n] = 7y[n-1]-12y[n-2]+x[n]$, but in the code the equivalent line is
Code:
    memo[n] = 7*f(n-1) - 12*f(n-2)
which seems to be short a term. I haven't tried to comprehend his methodology - but has he just made a typo?

Ibix said:
He defines his function as $y[n] = 7y[n-1]-12y[n-2]+x[n]$, but in the code the equivalent line is
Code:
    memo[n] = 7*f(n-1) - 12*f(n-2)
which seems to be short a term. I haven't tried to comprehend his methodology - but has he just made a typo?

The ##x[n]## term is mysterious to me. In the chapter 2 of the course notes, it is treated as an input that enforces boundary conditions on the difference equation.

I have posted in this thread. I'm puzzled why the x[n] is missing from the code, as well.

## 1. What is "Peel away and Guess" and how does it relate to Python?

"Peel away and Guess" is a game that helps beginners learn the basics of Python programming. It is a fun and interactive way to practice using the language and develop problem-solving skills.

## 2. What is the main objective of "Peel away and Guess"?

The main objective of "Peel away and Guess" is to teach players how to use Python syntax and logic by solving puzzles. The game focuses on key concepts such as data types, functions, loops, and conditional statements.

## 3. Is "Peel away and Guess" suitable for all levels of Python learners?

Yes, "Peel away and Guess" is suitable for all levels of Python learners. The game has different difficulty levels that allow players to progress at their own pace. It also provides hints and explanations to help beginners understand the concepts and syntax used.

## 4. Can "Peel away and Guess" be used as a teaching tool in a classroom setting?

Absolutely! "Peel away and Guess" can be a great addition to a Python course or workshop. It makes learning more engaging and can help students apply the concepts they have learned in a fun and interactive way.

## 5. Are there any other similar games or resources like "Peel away and Guess" for learning Python?

Yes, there are other games and resources available for learning Python, such as "Python Challenge" and "CodeCombat". These games also use puzzles and challenges to teach programming concepts and are suitable for learners of all levels.

Replies
8
Views
2K
Replies
0
Views
1K
Replies
4
Views
2K
Replies
7
Views
2K
Replies
51
Views
3K
Replies
11
Views
2K
Replies
75
Views
4K
Replies
10
Views
3K
Replies
13
Views
3K
Replies
48
Views
62K