-
-
Notifications
You must be signed in to change notification settings - Fork 342
Feat : Pascal's_Traingle #255
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new mathematics algorithm implementation for Pascal’s Triangle in R, including generation, element access, printing, derived properties, and visualizations.
- Introduces core functions: pascal_triangle, pascal_row, pascal_element, and helpers for sums, matrix, and odd-number pattern.
- Adds a formatted printer and a comprehensive (disabled) examples block demonstrating properties and usage.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
mathematics/pascal_triangle.r:1
- These are central binomial coefficients, not Catalan numbers. Either relabel the example as 'Central binomial coefficients' or compute Catalan numbers using choose(2n, n)/(n + 1).
# pascal_triangle.r
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 8 comments.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
🟨 Pascal’s Triangle Generator (R)
This script implements Pascal’s Triangle — a fundamental structure in combinatorics and number theory — using R.
Each entry in the triangle represents a binomial coefficient
C(n, k)and satisfies the recursive property:[
C(n, k) = C(n-1, k-1) + C(n-1, k)
]
📘 Features
C(n, k))⚙️ Functions Overview
pascal_triangle(n)nrowspascal_row(n)nth row (0-indexed)pascal_element(n, k)C(n, k)print_pascal_triangle(n, centered = TRUE)pascal_row_sum(n)n=2^npascal_all_row_sums(n)npascal_diagonal_sums(n)pascal_triangle_matrix(n)pascal_odd_pattern(n)🧩 Example Usage