Dividing whole numbers problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jack Higgs

    Dividing whole numbers problem

    I'm building a maths program for year 6 children.

    Problem with division - I generate a random number between say 1 and 1000. I
    want to generate another random number which when divided by the first
    number gives a whole number answer. Any Idea how I could do this? Obviously
    generating prime numbers is a bit of a problem as well!

    Cheers,

    Jack


  • Rick Rothstein

    #2
    Re: Dividing whole numbers problem

    > I'm building a maths program for year 6 children.[color=blue]
    >
    > Problem with division - I generate a random number between say 1 and[/color]
    1000. I[color=blue]
    > want to generate another random number which when divided by the first
    > number gives a whole number answer. Any Idea how I could do this?[/color]
    Obviously[color=blue]
    > generating prime numbers is a bit of a problem as well![/color]

    Instead of generating a number and trying to find whole number divisors,
    what about generating two numbers whose product is 1000 or less and then
    presenting that product and one of the numbers you used in the
    multiplication to the child... the other number is the answer. Something
    like this should work...

    FirstNumber = 1 + Int(50 * Rnd)
    MaxForSecondNum ber = Int(1000 / FirstNumber)
    SecondNumber = 1 + Int(MaxForSecon dNumber * Rnd)
    Product = FirstNumber * SecondNumber

    Of course, this doesn't address the "hardness" value of the division.

    Rick - MVP

    Comment

    • Jack Higgs

      #3
      Re: Dividing whole numbers problem


      "Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message
      news:dpmdnTKG5b DG3JvfRVn-3w@comcast.com. ..[color=blue][color=green]
      >> I'm building a maths program for year 6 children.
      >>
      >> Problem with division - I generate a random number between say 1 and[/color]
      > 1000. I[color=green]
      >> want to generate another random number which when divided by the first
      >> number gives a whole number answer. Any Idea how I could do this?[/color]
      > Obviously[color=green]
      >> generating prime numbers is a bit of a problem as well![/color]
      >
      > Instead of generating a number and trying to find whole number divisors,
      > what about generating two numbers whose product is 1000 or less and then
      > presenting that product and one of the numbers you used in the
      > multiplication to the child... the other number is the answer. Something
      > like this should work...
      >
      > FirstNumber = 1 + Int(50 * Rnd)
      > MaxForSecondNum ber = Int(1000 / FirstNumber)
      > SecondNumber = 1 + Int(MaxForSecon dNumber * Rnd)
      > Product = FirstNumber * SecondNumber
      >
      > Of course, this doesn't address the "hardness" value of the division.
      >
      > Rick - MVP
      >[/color]

      That's clever, thank you very much, it works a treat.

      Cheers,

      Jack


      Comment

      Working...