# Questions tagged [logic]

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

135 questions
Filter by
Sorted by
Tagged with
39 views

### Need help with Assumptions for an integral

I want to solve this Log, Integrate[2a Log[-a+((A0 + (y-y1)²)^½, {y1, 0,b}] But Mathematica only gives me long conditional expressions or imaginary numbers. I (my thinking which can be wrong) assume I ...
• 1
101 views

### How to solve logic problem with a joker sometimes tell truth and sometimes lie?

If there are only truth teller and liar, I used to solve with BooleanConvert or SatisfiabilityInstances. However for this one, ...
• 81
76 views

### Evaluation process of And, Or,

Small questions about evaluation process of And, Or. code 1) ...
• 3,221
289 views

### What's wrong with or? [closed]

Consider Clear[x]; x = 2; x < 2.9 || x > 3.1 This yields True So, everything is o. k. (interesting) But when you replace ...
• 123
89 views

### Simple way to express disjunction likes x==a || x==b || x==c ||

Is there a simple, shorter way to express x==1||x==2||x==3... ? For example, suppose that there is a roulette having integers 1 to 10 1> assigin 10% for 1 to 8 ...
• 3,221
226 views

### How to prove or disprove an inequality with Mathematica?

I mean there exist $\lambda>0, x\in \mathbb R$ s.t. the inequality $$\frac{3^{\lambda } e^x+e^{3 x}+1}{2^{\lambda } e^{2 x}}<\frac{1}{10^{100}}$$ is valid. Here are my unsuccessful attempts. <...
• 18.4k
60 views

### Logical functions with no arguments

I am trying to understand how logical functions are evaluated if no arguments are passed to them. {Or[], Nor[], And[], Nand[], Xor[], Xnor[]} {False, True, True, ...
• 19k
1 vote
33 views

### Reduce works for simple inequalities in Reals but not in Integers

In the domain of Reals Reduce correctly reduces the system to True: ...
• 1,315
1 vote
81 views

### How to transfer the logical expression to list of list?

As described in the title, I would wondering: How to transfer the solutions give by the following code ...
• 245
78 views

### How to unfolding (expand) logical expression?

How to expand the following expression ...
• 245
44 views

### Ordinal arithmetic

How can I compute with ordinals in mathematica? For instance, I'd like to query $2+\omega > 1 + 2 \omega$.
• 205
1 vote
107 views

### How to convert this Mathematica expression to another, as described here?

I am working on a function of which the core will consist of something like: ...
• 9,447
314 views

### How can I self-define a keyboard entry for 3-dot "Because"?

In Mathematica, there already exists a keyboard entry for 3-dot "Therefore", which provides great convenience for input as shown below. However, I find it a little odd that for its ...
• 443
56 views

### Intermediate results from SatisfiabilityInstances

I have a large logical expression, with roughly 100 boolean variables. I am interested in the solution with the smallest numbers of True. It seems there is no such ...
• 2,062
157 views

### For all x in {1,2,3}, x is bigger than 4

I am new to ForAll or Exists command. Resolve[ForAll[x, Element[x, Reals], x > 4]] gives ...
• 3,221
31 views

### LogitModelFit for predicting Categorical Variable

I was wondering how can I use LogitModelFit to predict the probability of a categorical variable based on non-categorially variables ?
• 41
1 vote
82 views

### TautologyQ like feature that also works for inequalities

If a=b and b=c, then a=c. So in mathematica, TautologyQ[(a == b) && (b == c) \[Implies] a == c, {a, b, c}] yields 'True'. If a<b and b<c, then a<c....
• 3,221
1 vote
32 views

### Conditional tab view

I'd like to create a tabview with conditions on it, rather than put the tabview inside an If statement, to reduce the length of my code. i.e. ...
• 53
1 vote
173 views

### How can I change the Mathematica programming for creating a Venn Diagram?

I am working on using Venn diagram to explain logic and logical connections between sets. After coming upon these answers: Create a Venn Diagram, How to plot Venn diagrams with Mathematica?, which I ...
• 1,097
1k views

### How can I use Mathematica to solve a complex truth-teller/liar logic problem?

I have a logic puzzle I want to convert to Mathematica to solve: Person A states, "Exactly two people are truth-tellers," Person B states, "I and Person C are truth-tellers." ...
• 1,097
205 views

### Incorrect result by DSolve

For real $x$ consider the trivial equation $$|y'(x)|=-|x|.$$ Since the left side is always positive and the right always negative, there is no solution. Let's try ...
• 1,005
147 views

### Axiomatizing naturals

Trying to implement the naturals in Mathematica, I follow E. Mendelson, Introduction to Mathematical Logic, Ch. 3, Par. 1. Here is my code for the axioms (exept the induction axiom) ...
• 18.4k
75 views

### How to check if solution to NSolve exists?

I'm trying to created a table where the entries are values of x, either given by x/.NSolve[...][] or a fixed value x0 if there is no numerical solution. Is there a way to find the truth value for ...
60 views

### perform logical or on sublist of a list efficiently

Given a huge list x of 0s and 1s and an increasing list i...
• 1,105
69 views

### First Order/Higher Order Logical Forward reasoning in Mathematica (Mathematica for FOL/HOL knowledge base)?

I am trying to develop Artificial Intelligence system that can automatically discover and apply reasoning patterns, templates, strategies (there is even theory for that - Cognitive Task Analysis). ...
• 101
137 views

### Natural deduction with FindEquationalProof

Out of curiosity, I'm trying to implement a natural deduction prover in Mathematica using FindEquationalProof. So far, I've implemented a few of the easier rules: <...
• 958
1 vote
63 views

### Solving a ForAll optimization problem in Mathematica

I am trying to solve the following optimization problem in Mathematica: Minimize[{y0 + y2 m2, ForAll[x, y0+y2 x^2 >= Boole[x>0]]}, {y0,y2}] Unfortunately, ...
• 443
297 views

### count conditional items in list

I have a list of the form: {1,1, (1 if x>y, -1 if y>=x), -1} I want to count the number of 1's in the list. The output I'm looking for is something of the ...
• 343
1 vote