Results 1 to 1 of 1

Math Help - Practical math problem...sort of a puzzle

  1. #1
    Newbie
    Joined
    Apr 2008
    Posts
    1

    Practical math problem...sort of a puzzle

    I am writing a program to delete old files on a computer. There will be a number of existing files and then a number of files to keep. You can also specify a "density" which determine which files are kept. The density is between 1 and 10. 1 indicates that older files will be kept more and 10 indicates that newer files will be kept. 5 indicates an equal number of older/newer files will be kept.

    The problem is, how do you represent this mathematically? For example, if you have 10 files and want to keep 5 and the density is 5, then you just keep every other file. If the density is 2 and there are 10 files and you want to keep 4 though, how can that be represented mathematically?

    I am assuming exponents/logarithms need to be used, but have yet to come up with a formula. Basically, taking the example above, when plugging in 1,2,3,4 (kept files= 1 to N, N=num kept), it returns the files you should keep (which would be something like 1,3,4,6 if density=2). Note that the files kept is loose....just as long as it skews toward the density. Nothing exact is needed. I expect that X would be the iteration for number to keep (like 1 to 4) and Y would be the density factor. The result would be the file # to keep, with files being numbered sequentially from 1 to N with 1 being the oldest.
    Last edited by michaeljc70; April 15th 2008 at 03:58 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 3
    Last Post: December 1st 2011, 11:46 AM
  2. Replies: 0
    Last Post: April 27th 2010, 07:19 PM
  3. Practical Math - Taxation
    Posted in the Algebra Forum
    Replies: 2
    Last Post: April 10th 2010, 11:30 PM
  4. five 3s math puzzle please help
    Posted in the Math Challenge Problems Forum
    Replies: 2
    Last Post: November 18th 2007, 05:04 AM
  5. Math egg puzzle Help
    Posted in the Math Topics Forum
    Replies: 1
    Last Post: January 24th 2007, 07:20 AM

Search Tags


/mathhelpforum @mathhelpforum