1
$\begingroup$

FullSimplify[Mod[t,10], t>101 && t<109]

It's a long shot, but can I get Mathematica to return t-100 or something similar for the above?

Currently it returns just Mod[t,10] itself, which is accurate, but I want even more simplification based on my conditions.

$\endgroup$

1 Answer 1

3
$\begingroup$

How about

Assuming[101 < t < 109, FullSimplify[PiecewiseExpand[Mod[t, 10]]]]

rhermans gives a simpler formulation:

PiecewiseExpand[Mod[t, 10], 101 < t < 109]
$\endgroup$
5
  • 1
    $\begingroup$ That works, even without the FullSimplify, but I'm not sure why, since PiecewiseExpand[Mod[t, 10]] just returns Mod[t, 10]. I'm guessing Assuming does some sort of Hold on its second argument, hmmm. Will investigate further on my own :) $\endgroup$
    – user1722
    Oct 9, 2015 at 15:09
  • $\begingroup$ That too PiecewiseExpand[Mod[t, 10], 101 < t < 109] $\endgroup$
    – rhermans
    Oct 9, 2015 at 15:10
  • $\begingroup$ Who knew that Mod was secretly a "nested piecewise function"! $\endgroup$
    – user1722
    Oct 9, 2015 at 15:11
  • $\begingroup$ Documentation says: "PiecewiseExpand converts such functions as If, Which, Abs, Max, UnitStep, and Floor to Piecewise. " $\endgroup$
    – rhermans
    Oct 9, 2015 at 15:12
  • $\begingroup$ I'm confused about the different ways the assumptions are used in each case, see this question $\endgroup$
    – rhermans
    Oct 9, 2015 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy