Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pascals-triangle: split into instructions and introduction #2449

Merged
merged 11 commits into from
Jun 25, 2024

Conversation

ErikSchierboom
Copy link
Member

No description provided.

@@ -0,0 +1,3 @@
# Instructions

Your task is to output the first N rows of Pascal's Triangle.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need more here? Some examples?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example explicitly showing the addition process like in https://en.wikipedia.org/wiki/Pascal%27s_triangle#/media/File:PascalTriangleAnimated2.gif might be handy. I think that's where students might get stuck. Once you've got over that, I don't think additional examples provide a lot of extra insight. The modeled triangle doesn't change, just the number of rows exported.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't come up with a story here. I'm open to suggestions :)

Copy link
Contributor

@jiegillet jiegillet May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh, I didn't even know you could comment on files, TIL.

Pascal's Triangle is a classic: here are some stuff you can do with it, maybe inspiration will strike:

  • You can draw a Sierpinski triangle by coloring the even/odd numbers
  • the sum of each row is a power of 2
  • each element is a combination, entry k in row n tells you how many ways you can pick k elements from n
  • squishing all the numbers in a row gives you a power of 11 (1331 = 11^3, 14641 = 11^4)

It's all a bit nerdy, but that can be a good thing :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the third one is most suitable for a story. Thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had no idea there were so many things you could do with it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, there's more, there are so many patterns in these numbers. Fibonacci numbers are also hiding in there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much more!

  • An especially accessible list of patterns: Pascal's Triangle @ MathIsFun. Possibly interesting exercise: spot the duplicates. Most of the patterns listed here are really the very same pattern, just phrased in different ways.

  • Skim the images in the Wikipedia article for hints at more patterns, elaborated on in the text.

exercises/pascals-triangle/instructions.md Outdated Show resolved Hide resolved
@@ -0,0 +1,3 @@
# Instructions

Your task is to output the first N rows of Pascal's Triangle.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example explicitly showing the addition process like in https://en.wikipedia.org/wiki/Pascal%27s_triangle#/media/File:PascalTriangleAnimated2.gif might be handy. I think that's where students might get stuck. Once you've got over that, I don't think additional examples provide a lot of extra insight. The modeled triangle doesn't change, just the number of rows exported.

@ErikSchierboom
Copy link
Member Author

@BNAndras I've added a bit more text, but so far struggled to visually and textually explain the logic. I'm open to suggestions.

@ErikSchierboom ErikSchierboom marked this pull request as ready for review June 5, 2024 12:14
@ErikSchierboom ErikSchierboom requested a review from a team as a code owner June 5, 2024 12:14
@ErikSchierboom
Copy link
Member Author

I've added a story and updated the instructions.

exercises/pascals-triangle/introduction.md Outdated Show resolved Hide resolved
Copy link
Contributor

@ConeDragon ConeDragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussing about the "math is boring" part, I found this on line 3:
With the weather being great, you're not looking forward to spending an hour in a classroom doing math.

Copy link
Member

@kotp kotp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style consistency for "single sentence per line" regarding a link given, the change will match the link on line 15 (prior to change being made).

Broke up the long line with the colon being a separator. While a single sentence, this is a reasonable exception to the strict "one sentence per line" and still supports the reason why we have that style adopted, I think.

exercises/pascals-triangle/introduction.md Outdated Show resolved Hide resolved

With the weather being great, you're not looking forward to spending an hour in a classroom doing math.
Annoyed, you enter the class room, where you notice a strangely satisfying triangle shape on the blackboard.
Whilst waiting for your math teacher to arrive, you can't help but notice some patterns in the triangle: the outer values are all ones, each subsequent row has one more value than its previous row and the triangle is symmetrical.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Whilst waiting for your math teacher to arrive, you can't help but notice some patterns in the triangle: the outer values are all ones, each subsequent row has one more value than its previous row and the triangle is symmetrical.
Whilst waiting for your math teacher to arrive, you can't help but notice some patterns in the triangle:
the outer values are all ones, each subsequent row has one more value than its previous row and the triangle is symmetrical.

@jiegillet
Copy link
Contributor

After discussing about the "math is boring" part, I found this on line 3: With the weather being great, you're not looking forward to spending an hour in a classroom doing math.

I personally thought that this was fine, because one can enjoy math but still enjoy great weather more.
Maybe removing "doing math" could emphasize that this is really about the weather.

@ErikSchierboom
Copy link
Member Author

I've updated!

@ErikSchierboom ErikSchierboom merged commit 9607704 into main Jun 25, 2024
7 checks passed
@ErikSchierboom ErikSchierboom deleted the split-pascals-triangle branch June 25, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants