Skip to content

Inclusion-exclusion digit sum problem details #1176

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

Merged
merged 4 commits into from
Oct 22, 2023

Conversation

jxu
Copy link
Contributor

@jxu jxu commented Oct 20, 2023

Add example problem, general formula, and for that problem, comparison to other approaches.
Feel free to edit commit messages or anything.

@jxu
Copy link
Contributor Author

jxu commented Oct 20, 2023

Looks like some emoji library made the build fail.

@jakobkogler
Copy link
Member

Looks like there was a change in the Emoji-Library.
Fixed it in #1179

@github-actions
Copy link
Contributor

Visit the preview URL for this PR (for commit b22e03f):

https://cp-algorithms--preview-1176-asssoqp3.web.app

(expires 2023-10-29T15:43:29.299635396Z)

Copy link
Member

@jakobkogler jakobkogler left a comment

Choose a reason for hiding this comment

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

I've removed that base-b digit sum example. I don't think it adds something new to the problem.
Maybe if the problem started like, but not as an example interpretation of a already given problem.

Also, in the sum one of the values was off by one.
You initially had $x_i < b$, and subtracted $b-1$ each time, where it should be $b$ instead.
I've now changed it to $x_i \le b$ and subtract $b+1$, to match the problem from above.

@jakobkogler jakobkogler merged commit 634fe39 into cp-algorithms:master Oct 22, 2023
@jxu
Copy link
Contributor Author

jxu commented Oct 22, 2023

Thank you for the correction. I think the fixed formula comes out nicer with an exclusive upper bound for base b, but I get that that's not how the original problem was posed (had nothing to do with base). Maybe b should be renamed since it doesn't stand for base now.

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.

2 participants