, ▁d ither ing , ▁and ▁a ▁related ▁technique , ▁error ▁diffusion , ▁are ▁normally ▁used . ▁A ▁related ▁technique ▁called ▁pul se - width ▁mod ulation ▁is ▁used ▁to ▁achieve ▁analog ▁type ▁output ▁from ▁an ▁in ert ial ▁device ▁by ▁rapidly ▁pul sing ▁the ▁power ▁with ▁a ▁variable ▁duty ▁cycle . ▁ ▁Error ▁diffusion ▁tries ▁to ▁ensure ▁the ▁error , ▁on ▁average , ▁is ▁minim ized . ▁When ▁dealing ▁with ▁a ▁gentle ▁slope ▁from ▁one ▁to ▁zero , ▁the ▁output ▁would ▁be ▁zero ▁for ▁the ▁first ▁few ▁terms ▁until ▁the ▁sum ▁of ▁the ▁error ▁and ▁the ▁current ▁value ▁becomes ▁greater ▁than ▁ 0 . 5 , ▁in ▁which ▁case ▁a ▁ 1 ▁is ▁output ▁and ▁the ▁difference ▁subtract ed ▁from ▁the ▁error ▁so ▁far . ▁F loyd – Ste in berg ▁d ither ing ▁is ▁a ▁popular ▁error ▁diffusion ▁procedure ▁when ▁digit izing ▁images . ▁ ▁As ▁a ▁one - dimensional ▁example , ▁suppose ▁the ▁numbers ▁, ▁, ▁, ▁and ▁ ▁occur ▁in ▁order ▁and ▁each ▁is ▁to ▁be ▁rounded ▁to ▁a ▁multiple ▁of ▁. ▁In ▁this ▁case ▁the ▁cum ulative ▁sums , ▁, ▁, ▁, ▁and ▁, ▁are ▁each ▁rounded ▁to ▁a ▁multiple ▁of ▁: ▁, ▁, ▁, ▁and ▁. ▁The ▁first ▁of ▁these ▁and ▁the ▁differences ▁of ▁adjacent ▁values ▁give ▁the ▁desired ▁rounded ▁values : ▁, ▁, ▁, ▁and ▁. ▁ ▁Monte ▁Carlo ▁arithmetic ▁Monte ▁Carlo ▁arithmetic ▁is ▁a ▁technique ▁in ▁Monte ▁Carlo ▁methods ▁where ▁the ▁round ing ▁is ▁randomly ▁up ▁or ▁down . ▁Sto ch astic ▁round ing ▁can