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

Tip about the UVa 00725 - Division #113

Open
marcoshass opened this issue Jul 21, 2024 · 1 comment
Open

Tip about the UVa 00725 - Division #113

marcoshass opened this issue Jul 21, 2024 · 1 comment

Comments

@marcoshass
Copy link

marcoshass commented Jul 21, 2024

Hi, I have cpbook 4th edition and I'm struggling to understand the UVa 00725 problem:

Ref UVa 00725
Find and display all pairs of 5-digit numbers that collectively
use the digits 0 through 9 once each, such that the first number divided by the second is
equal to an integer N, where 2 ≤ N ≤ 79. That is, abcde/fghij = N, where each letter
represents a different digit. The first digit of one of the numbers is allowed to be zero, e.g.,
for N = 62, we have 79546/01283 = 62; 94736/01528 = 62.

2nd paragraph on page 131 says:

"Quick analysis shows that fghij can only range from 01234 to 98765 which is at most ≈ 100K possibilities"

But I have no idea how this analysis was performed, could someone give a hint on how these 100K possibilities were obtained? something step by step would help ..
Thks!

@seffendy
Copy link
Collaborator

It's just a rough approximation.

The number of possible values for fghij is the same as the number of ordered subsets of size 5 from a set with 10 elements -- this is what a permutation is.

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

No branches or pull requests

2 participants