Generating division problems with integer results

In summary: Not sure if I can get around storing the list of possible divisors from which I pick if I want to choose one randomly, but also probably not a huge problem for values people are likely to want to use.In summary, the application is for practicing mental arithmetic. Most of the features are pretty easy, with the exception of division, which is the topic here. There will be a checkbox for "Integer results only", which would be my default until I implement fixed point.
  • #1
Grep
298
3
I'm not sure at all how best to approach this problem. Basically, the application is for practicing mental arithmetic. Most of the features are pretty easy, with the exception of division, which is the topic here.

I accept a minimum and maximum for the first and last numbers in the division. I haven't gotten to decimal points and fixed point yet. There will be a checkbox for "Integer results only", which would be my default until I implement fixed point. And that adds a wrinkle in for which I've not found a graceful answer.

Keep in mind the configuration values for the problem generation are open to change, so if that makes it much easier, that's a possibility. Possibly, not providing min/max for both values in the division might make it easier.

Given the allowed ranges for the first and last values of the division, I need to first make sure those values work. It's quite possible to enter values which means there are no possible integer results. For example, firstMin=3, firstMax=5, lastMin=3, lastMax=5. Clearly, nothing between 5 and 3 is divisible by any number between 5 and 3.

Beyond that, I'm not sure what the best way is to generate these numbers. Roots with integer results were so much easier. I can't think of a way without checking divisibility of the first number by every possible second number. Not sure it's even possible.

Any thoughts? Opinions greatly appreciated! I'd like to move on to implementing fixed point, state saving and graphs.
 
Technology news on Phys.org
  • #2
I can't think of a way without checking divisibility of the first number by every possible second number.
What's wrong with this solution? Have you actually coded it up and found that you really need something faster?
 
  • #3
Hurkyl said:
What's wrong with this solution? Have you actually coded it up and found that you really need something faster?

heh I suppose you're probably right. In theory, I want to make sure it scales up to fairly large numbers, but it's not like I'm about to care about factorizing truly large numbers. So perhaps time won't be a factor.

I may as well code it up that way and see how well it works. Extra time should be negligible for value ranges most people would ever try. The more I think about it, the more I realize you're probably right.

Not sure if I can get around storing the list of possible divisors from which I pick if I want to choose one randomly, but also probably not a huge problem for values people are likely to want to use.

Thanks for the comment!
 
  • #4
For the record, it's easier to choose quotient and divisor than it is to choose dividend and divisor. And you can get some mileage out of interval arithmetic -- e.g. you can compute the largest and smallest quotients that can be produced by dividing numbers in the two intervals you supplied.

Also, why do the given intervals have to be on the dividend and divisor? :wink:


P.S. your example allows 4/4=1.
 
  • #5
Hurkyl said:
For the record, it's easier to choose quotient and divisor than it is to choose dividend and divisor. ...

That's what I would do; generate a pair of random integers, find their product and display it.
 
  • #6
Hurkyl said:
For the record, it's easier to choose quotient and divisor than it is to choose dividend and divisor. And you can get some mileage out of interval arithmetic -- e.g. you can compute the largest and smallest quotients that can be produced by dividing numbers in the two intervals you supplied.

Also, why do the given intervals have to be on the dividend and divisor? :wink:

Yeah, I wish I could do that. But given what the app does, it's much more logical, I think, for the user to set the min/max range of the dividend and divisor. Certainly more logical when "Integer results only" is disabled. It also matches what is done in the other modules for addition, subtraction, etc.

I did implement it yesterday, and it works fine. Speed isn't an issue so far. Probably won't be.

Hurkyl said:
P.S. your example allows 4/4=1.

True, I exclude that for the obvious reason that it's totally trivial (I don't even go past half the dividend since after that, the number can't possibly divide it except in the trivial case). I may add a checkbox for "Exclude trivial results", but that might be overkill. I see no reason anyone would ever want that kind of division problem. Let's just say that if you need to practice them, you need more than a little practice at mental arithmetic. Like a new brain.

It's probably about time I started on implementing decimal points and fixed point math. Would be nice to release this thing before the end of the year. :smile: I admit, it's pretty useful as it is now, though. Now if only I knew someone who could make me some nice icons for the toolbar for free...

Thanks folks!
 
  • #7
Grep said:
Now if only I knew someone who could make me some nice icons for the toolbar for free...

Is it open source? If it is, there is an excessively large selection. If not, there's still non-viral /permissive licenses like CC-BY, LGPL, BSD, and public domain that allow you to use their icons with your [proprietary] program, with conditions(like requiring attribution).

This page has quite a few links you may be able to use. http://openiconlibrary.sourceforge.net/LICENSES.html
 
Last edited by a moderator:
  • #8
TylerH said:
Is it open source? If it is, there is an excessively large selection. If not, there's still non-viral /permissive licenses like CC-BY, LGPL, BSD, and public domain that allow you to use their icons with your [proprietary] program, with conditions(like requiring attribution).

This page has quite a few links you may be able to use. http://openiconlibrary.sourceforge.net/LICENSES.html

Thanks TylerH. I looked on that site previously and hadn't found anything that would work. And I'm not sure which license I'll go for either, so that's a problem. Great site though, thanks!
 
Last edited by a moderator:

What is meant by "generating division problems with integer results"?

"Generating division problems with integer results" refers to the process of creating mathematical equations that involve dividing one number by another, and the resulting answer is a whole number or integer. This type of division is commonly used in everyday life, such as splitting a pizza evenly between a group of friends.

Why is it important to generate division problems with integer results?

Generating division problems with integer results is important because it helps build a strong foundation in basic math skills. It also allows for a better understanding of fractions and decimals, which are commonly used in more advanced math concepts.

How are division problems with integer results different from other types of division problems?

Division problems with integer results are different from other types of division problems because the answer is always a whole number or integer. Other types of division problems may result in a fraction or decimal.

What are some strategies for generating division problems with integer results?

One strategy for generating division problems with integer results is to choose two numbers that have a common factor. Another strategy is to use the multiplication table to find two numbers that have a product that is a multiple of the divisor.

Can division problems with integer results be solved using mental math?

Yes, division problems with integer results can be solved using mental math. This is because the numbers involved are usually smaller and easier to work with compared to division problems with fractions or decimals. However, it is always recommended to check the answer using a calculator or written method.

Similar threads

Replies
9
Views
1K
  • Programming and Computer Science
Replies
16
Views
1K
  • General Math
2
Replies
47
Views
3K
  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
17
Views
1K
  • Programming and Computer Science
Replies
21
Views
6K
  • Programming and Computer Science
Replies
21
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Programming and Computer Science
Replies
4
Views
2K
  • Precalculus Mathematics Homework Help
Replies
3
Views
638
Back
Top