Introducing Logical Tests in Equations?

  • Thread starter Thread starter ktoz
  • Start date Start date
AI Thread Summary
Introducing logical tests in equations can enhance mathematical expressions, as demonstrated by the C operator "?:" which allows for conditional value assignments. An example provided shows how to use this in a product equation, where values less than 1 are replaced with 1. The discussion also highlights the use of functions like the Dirac delta function, which can be defined with logical conditions. An alternative notation, using brackets to denote truth values, is suggested for clarity. Overall, while incorporating logical tests is feasible, it is advisable to choose distinct symbols to avoid confusion with established functions.
ktoz
Messages
170
Reaction score
12
Is there a way to introduce logical tests into equations? For example, C has a very useful operator "?:" which returns values like so:

x = (x < 1) ? 1 : x;

which could be used in equations like this to multiply by 1 for any value less than 1.

Q(x) = \prod_{j=-5}^x ((j &lt; 1) ? 1 : j)

Just wondering...

Ken
 
Last edited:
Mathematics news on Phys.org
One often defines functions, like:

<br /> \delta(x) := \left\{<br /> \begin{array}{ll}<br /> 1 \quad &amp; x = 0 \\<br /> 0 &amp; x \neq 0<br /> \end{array}<br />

I've also seen the handy little notation [P] which is 1 if P is true, and 0 if P is false. E.G. the aforementioned function could be written as \delta(x) := [x = 0]
 
Very nice!

Thanks Hurkyl

So for my example it could be defined like:

<br /> \delta(x) := \left\{<br /> \begin{array}{ll}<br /> 1 \quad &amp; x &lt; 1 \\<br /> x &amp; x \geq 1<br /> \end{array}<br />

<br /> Q(x) = \prod_{j= -5}^x \delta(j)<br />

Would that be legal?
 
Last edited:
Yes, but we usually reserve \delta for that particular function. You would probably want to use a different symbol.
 
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top