if we add all these equationsmost of the ti terms cancelleaving ci tn = or equivalentlyn ci (tn = recall that and tn the number of trees after the insertionsis certainly not negativeso (tn is not negative thus ci < = which proves the claim during the buildbinomialqueue routineeach insertion had worstcase time of (log )but since the entire routine used at most units of timethe insertions behaved as though each used no more than two units each this example illustrates the general technique we will use the state of the data structure at any time is given by function known as the potential the potential function is not maintained by the programbut rather is an accounting device that will help with the analysis when operations take less time than we have allocated for themthe unused time is "savedin the form of higher potential in our examplethe potential of the data structure is simply the number of trees in the analysis abovewhen we have insertions that use only one unit instead of the two units that are allocatedthe extra unit is saved for later by an increase in potential when operations occur that exceed the allotted timethen the excess time is accounted for by decrease in potential one may view the potential as representing savings account if an operation uses less than its allotted timethe difference is saved for use later on by more expensive operations figure shows the cumulative running time used by buildbinomialqueue over sequence of insertions observe that the running time never exceeds and that the potential in the binomial queue after any insertion measures the amount of savings once potential function is chosenwe write the main equationtactual potential tamortized ( tactual the actual time of an operationrepresents the exact (observedamount of time required to execute particular operation in binary search treefor examplethe actual time to perform find(xis plus the depth of the node containing if we sum the basic equation over the entire sequenceand if the final potential is at least as large as the initial potentialthen the amortized time is an upper bound on the actual time used during the execution of the sequence notice that while tactual varies from operation to operationtamortized is stable picking potential function that proves meaningful bound is very tricky taskthere is no one method that is used generallymany potential functions are tried before the one