Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have this problem about account record pagination. I have to write the function that describes the total pages needed to contain those account records.

This is the problem:

# Account record quantity to store per page
per_page € R 
# Account records to insert in pages
tot_acc € R 

# The total pages needed to store the `tot_account` quantity
f(per_page,tot_acc) = tot_page € R = ? 

I need to find f(per_page,tot_acc).

share|improve this question
    
You'll need to explain what these quantities mean. –  joriki Mar 12 '11 at 0:09
    
@joriki I updated the question. –  user8136 Mar 12 '11 at 0:18

1 Answer 1

up vote 1 down vote accepted

Are you asking something like:

With all variables as integers, given the first page number of a set of accounts $i$, the number of accounts that can fit on a page $d$, the total number of accounts $n$, what is the number of the last page?

If so, then you need to use $\left\lceil \frac{n}{d}\right\rceil$ pages for the accounts where the brackets mean ceiling i.e. round up to the next integer. You need to add that to the page before the starting point $i-1$ to give the final page of the accounts $$f(i,d,n) = \left\lceil \frac{n}{d}\right\rceil + i -1$$ or if you prefer $$\text{tot_page} = f(\text{page, per_page, tot_acc}) = \left\lceil \frac{\text{tot_acc}}{\text{per_page}}\right\rceil + \text{page} -1.$$

Perhaps you were asking something else.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.