Questions on use and formulation of logical operations, including both functions for programming and for mathematical operations.

learn more… | top users | synonyms

0
votes
1answer
61 views

How to do symbolic logic in Mathematica

I'm currently in Symbolic Logic with homework assignments (not asking for people to do my homework for me) with questions such as the following: (derive the conclusion using the eighteen rules of ...
1
vote
1answer
70 views

How to use recursion to find a logical dual

I want to make a little function that goes through a propositional formula and gives it's dual. Here is what I currently have: ...
6
votes
1answer
130 views

Is there an easy way to do set counting in Mathematica?

I'm using counts of elements in sets, along with logic. So, for instance, I'd like to determine if Count[$a \land \neg b$] = Count [$a$] - Count[$a \land b$] ...where ...
0
votes
2answers
63 views

How to prove that an equation can be divided by any n?

I'm new to Mathematica and came across with the problem. I can't prove that (for example) 2*n is always even no matter what n ...
11
votes
0answers
107 views

Logical AND of multiple patterns

Mathematica provides an equivalent for "logical OR" when pattern matching, using Alternatives or the infix | operator. For ...
0
votes
0answers
53 views

Function that outputs the dual of the formula

The exercise is simple: define a function that gives the dual of the formula. While I have experience in mathematics and logic, I do not have real experience in programming. Logic is propositional ...
3
votes
2answers
67 views

Creating Boolean expressions over a set of indexed variables

I've read lots of examples here on how to set one matrix Equal to another, but how do you nest And and ...
3
votes
1answer
39 views

Getting a set of disjoint regions from the set of overlapping regions

Suppose I have two overlapping regions $R1$ and $R2$ looking like this: ...
8
votes
2answers
252 views

TrueQ returning False on true statement

Why does TrueQ return False on the following? TrueQ[Log[2]/Log[8] == 1/3] (* False *) ...
22
votes
4answers
5k views

Elegant solution to the Zebra [logic] Puzzle (“Einstein's Riddle”)

The famous Zebra Puzzle (Wikipedia), often called "Einstein's Riddle," is a logic puzzle that can be solved deductively by applying a list of logical rules. One version of the riddle (from Wikipedia) ...
4
votes
1answer
54 views

Clues on theorem proving tools?

I'm trying to prove $[a \cup (b \cap c ) = (a\cup b)\cap (a\cup c)]$ with mathematica. But I don't know what function I should use. I've rewritten the sentence in the following way: ...
1
vote
1answer
85 views

How can I draw truth tables using Mathematica [duplicate]

For instance, the given expression p ⊕ (p v q) In the problem I'm trying to solve. There's a Mathematica answer to this: ...
3
votes
0answers
63 views

Simplifying between set theory and logical connectives

I'm trying to find out how to switch between set notation and logic, but am having difficulty. For instance, I know that the following two expressions are equivalent ...
1
vote
0answers
36 views

Solving systems of logial and set theoretic propositions

I need to allocate a couple of dozen elements into different sets, respecting some boundary conditions, and was hoping Mathematica might somehow help. A simple example: The propositions being a) a ...
4
votes
3answers
411 views

What exactly is Implies? Is it a logical test?

I ran the following to simplify my logical test (expecting something in terms of And and Or ...) ...
22
votes
1answer
628 views

How can we create Randolph diagrams in Mathematica?

I have become fascinated with Randolph Diagrams and was wondering how we would create the diagrams from logical sequences using Mathematica? It looks like it would be a combination of logic and ...
2
votes
0answers
60 views

Is there a way to make a set of all real numbers within a range? [closed]

Is there a way to create a set of all real numbers within a range? For example, the range between 1300 and 1500, including 1500 in normal distribution. Thank you very much. My problem exactly: $A$ ...
3
votes
1answer
52 views

How to get Mathematica to make further simplifications to conditional expressions than it has already made?

I have the following Mathematica result under the assumption that {ax, bx, px, ay, by, py} \[Element] Reals, and after refinement by ...
3
votes
2answers
56 views

Boolean value of proposition assuming previous boolean values of parts of the proposition

Is it possible to ask Mathematica to give us the boolean value of a proposition assuming the boolean value of some parts of it? For instance, give the boolean value of $p\vee q$ assuming that $p$ is ...
5
votes
2answers
140 views

FunctionInterpolation and Which combine badly

Update 2: Got two solid answers, but had trouble implementing one, and found the other could only save me computation time by sacrificing accuracy. So I chose neither as an official answer, but ...
5
votes
0answers
152 views

Logic programming with Mathematica

My question is: Wikipedia says that there is logic programming paradigm support in Mathematica (like In Prolog). Could anyone provide me with an example of using this paradigm in Mathematica?
5
votes
0answers
100 views

Using quantifiers with free indices as declarative conditions in equation solving

This is a toy example: Is there a way to rewrite Reduce[{Norm@{c[1], c[2], c[3]} == 1, 0 <= c[1] < c[2] < c[3]}, {c[1], c[2], c[3]}] ...
3
votes
1answer
103 views

Defining an arbitrary binary relation

I am trying to define some binary operators. A binary operator operates on a set of variables V and is defined by a subset S of pairs of those variables {Vi,Vj}. For example, "=",">",">=" are all ...
0
votes
2answers
125 views

How may I define e.g. Tilde[x,y] to have certain properties?

I would like to define, e.g., the Tilde[x,y] operator to have certain properties, and then investigate whether certain expressions involving that operator are True or not. For example, if I specify ...
1
vote
3answers
261 views

Writing code to update a large matrix?

How can I write a code to update a matrix based on certain rules? I plan on constructing a large matrix, and I cannot submit entries one by one. The rules for the matrix are as followed: $$ ...
1
vote
1answer
108 views

How to do predicate logic in Mathematica

I'm trying to formalize and analyze the following reasoning: All equilateral triangles are isosceles triangles. Some triangles are not equilateral triangles. Therefore some triangles are not ...
-1
votes
2answers
92 views

Logical Circuit [closed]

Does somebody know about how to simulate this in Mathematica? I want to give Mathematica the two Inputvalues x,y and it should output c,s. $$c=x\land y$$ $$s=x\veebar y$$ $$x,y\in \{0,1\}$$
0
votes
1answer
47 views

Resolving a logical statement

I would like to test whether f[n] > 0 and f[n + 1] > 0 implies f[n + 2] > 0. This ...
4
votes
1answer
169 views

Mathematica as Answer Set Programming (ASP) engine?

Maybe I need to rephrase this question, so that it might receive some attention: Are there any packages or examples of how to put Mathematica to good use in the field of ASP (Answer Set Programming) ...
-1
votes
1answer
214 views

Logic Gates - How to show eight ways an AND function can be realized using negative and postivie logic [closed]

I am asked to use negative and positive logic (using bubbles on the gates) to show eight ways that an AND function can be realized. Im not too sure how to do this. The only way I can create an AND ...
3
votes
4answers
290 views

Simplify binary expressions

Is it possible for Mathematica to do simplifications for expressions where the variables are binary, such as: a + b = 1 + 2*c => a + b = 1 Here c must be 0 because if it is 1, the RHS is 3 but ...
0
votes
2answers
65 views

PEANO Integers using successor function

I'd like to define the integers and operations on it by using terms. Starting from zero->init[] and nth->succ[n-1th] where succ[] is the successor function. I ...
1
vote
1answer
740 views

How would I input this truth table into Mathematica or Wolfram Alpha

I am unsure how to put the negations after a gate or before a gate?
2
votes
1answer
283 views

GUI of a Karnaugh Map (2)

Adopting kguler's answer to my previous question, I managed to get the simplified map by using Mathematica's build-in function BooleanMinimize. The tough job left ...
1
vote
3answers
149 views

How to limit only two “0 and 1” strings for an xor implement?

I tried to implement some logic gates for a series of "0 & 1" strings, just like and, or, nand, nor and not listed below. How could I limit xor only accept a two strings list as its argument? ...
1
vote
1answer
63 views

What domain does Resolve assume by default?

Consider the statement: $\forall x\left(x<7\Rightarrow \exists a\exists b\exists c(a^2+b^2+c^2=x)\right)$ This is true provided the universe of discourse is $\mathbb{N}$ Now I use ...
-1
votes
1answer
122 views

Transformation of a simple logic statement

I'm designing a logic circuit and I was wondering if the following two things are equivalent: (x <= y) and (x < (y + 1)) I can't think of any set of numbers that would make these two things ...
5
votes
2answers
265 views

How to “ReplaceAll” using a set of conditional expressions instead of a list of rules [closed]

Suppose that I have two linear functions f[x_] := f0 + f1 x g[x_] := g0 + g1 x and a (possibly rather complicated) set of conditional expressions, obtained ...
1
vote
1answer
538 views

How to generate the truth table to prove logical equivalence?

How to generate the truth table to show that $p \implies (q \vee r)$ is equivalent to $(p \wedge \neg q ) \implies r$ ? Can I use BooleanTable?
5
votes
2answers
173 views

Equality and Quantifiers

I am new to Mathematica and to Math. I do not study math in English, so please bear with me as I try to state my questions.. This is what I am trying to "solve": $$∃!x : A(x) ⇔ ∃x : ¬A(x)$$ In ...
1
vote
1answer
143 views

Assumptions in mathematica when Symplify on Log[Exp[a/b]]

In mathematica 9.0: This: Assuming[b > 0 || b < 0, Simplify[Log[Exp[a/b]]]] yields: a/b However, this: ...
2
votes
1answer
92 views

Make MyLogicalExpand

The function by Mathematica to expand a formulation with ANDS, ORS, NOT, XOR, and others, is LogicalExpand, let see an example: ...
0
votes
1answer
241 views

Testing Equality Expression?

Even if in Graph[{1 -> 2}] == Graph[{1 \[DirectedEdge] 2}] the answer is True ; but why MMA doesn't show the result of the ...
0
votes
2answers
152 views

How to add variables to boolean expression and get conjunctive normal form?

I have the boolean expression (a && !b). I want to add variables c, d into the ...
0
votes
1answer
110 views

Replace !x with x != 1

I have some logical relationships that I ultimately want to pass to NMaximize as constraints: ...
13
votes
2answers
877 views

How to solve the liar problem?

In an island live two kinds of people: liar and truth-teller, the former only tells lies and the latter only tells truth, now there're two men A and B from the island, A said: "B is a truth-teller." B ...
5
votes
3answers
1k views

How to prove an expression by method of mathematical induction?

I want to prove the expression $$1^2 + 2^2 + 3^2 + \cdots + n^2 = \dfrac{n(n+1)(2n+1)}{6}$$ by method of mathematical induction with Mathematica, but I do not know how to start. How do I tell ...
3
votes
2answers
407 views

How to determine all cases consistent with constraints

Suppose that $(i, j), (k, l)$ and $(m, n)$ are pairs of non-negative integers, satisfying the following constraints: $$i < j,\;\; k < l, \;\; m < n$$ and $$ (i, j) < (k, l) < (m, ...
1
vote
3answers
595 views

Creating a Specific Boolean Function

How can I implement a Boolean function F(A,B) that has outputs that are not specific and, therefore, the truth table output of this two-input function will be (a, b, c, d) -- here the first term ...