# Questions tagged [logic]

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

102 questions
Filter by
Sorted by
Tagged with
63 views

### Is there simplest and universal way to ask Mathematica to give you in which cases it is True and in which False? [closed]

This question emerged from this comment. This answer explains how to do that with particular equation with several steps but I am interested if there exists more simple and universal method to just ...
925 views

### Why I am not getting True when testing equation?

My input is: $\frac{1}{a^x}==(\frac{1}{a})^x$ I want to get output: True But getting output: $a^{-x}==\left(\frac{1}{a}\right)^x$ Question: How to get ...
61 views

### Convert ProofNotes to $\mathrm\LaTeX$ logic expression

The following code will generate some ProofNotes: ...
71 views

47 views

### Help with actions in EventHandler

I am trying to write a program where the user types on the keyboard in a specified location, and Mathematica outputs what you are currently typing, plus a prediction that is updated in real time of ...
31 views

### List of elements joined by OR condition

A simple command Or[f, f, f] gives f || f || f How this can be done automatically? I try ...
369 views

### Given list of associations, generate a list of all common associations

Given a list of parameters and associated values, how can I generate a list of all common associations? For instance, given ...
140 views

### Apply Complement to a list of matrices

With a list of defined matrices list={a,b,c,d} How can I apply Complement to obtain Complement[list,{b,c}]=={a,d}
45 views

### Speeding up multiple conditional summations

I have situation where I have a matrix H, and want to build a set of ODEs dependent on the values of the eigenvalues, let me illustrate: ...
99 views

### For loop from a continous position [closed]

I have a matrix A, which has its elements being function of m, say A[m_]={m, -m*m+2, 5x+m, 3*m+2, -m*m*m, -3+m, m, 5*m*m-4*m, 2*m*m*m} Now, there is a double ...
53 views

### How to write down existence and uniqueness?

Mathematica has strong commands ForAlland Exists. However, I face difficulties, trying to express "existence and uniqueness" in ...
59 views

### Discarding a triple because of the absence of monotonicity

Sorry for the title, but I can not think of a better one. Starting informally, monotonicity says that if the number of votes for i is greater that the number of ...
184 views

### How to create logical matrix in Mathematica? [closed]

Is it possible to create logical Matrices in Mathematica as it is possible in Matlab with false(nrow,ncol) or true(nrow,ncol)? ...
83 views

### Reduce redundant conditions all the way

I would expect Reduce[(b == 0) || (a == 0 && b == 0)] to give b==0 since the second argument of ...
83 views

### What's wrong with my logic statement here?

tl;dr: pls fix my spaghetti code Hi all. I'm a physics undergrad and I work in a lab at my university doing gamma spec. Mostly for fun/learning to program, I'm trying to write a module that reads the ...
90 views

### Translating arguments into Predicate Logic

Consider the paragraph given below. If all the boy friends are either HH or NN, then there are no CC.but Jone is a CC. therefore some boy friends are not NN.. a) translate the following arguments ...
98 views

### Choose numerical values according to given rules

General problem Given a set of logical expressions I need to find numbers with a margin between pairs that obey the logical rules. Example For the expression $m=n=o,p=q$ with a margin of 10 the ...
87 views

### How to solve this problem in Mathematica?

Let's say we have some 4-character strings: fxhg eagc aceh chbe beca From those strings we want to get the correct passcode. Each of the string contains two ...
253 views

### How to explain False == x && True == x

Execute the following code: ...
60 views

### The position of the quantifier

I know this is a logical operation in discrete mathematics. ...
85 views

### Logical test of a single symbol against multiple values

I'm currently trying a function that behaves differently depending on what kind of Type string you enter. This string can have six different values, let's say "A", "B", "C", "D", "E" and "F". What I ...
266 views

### Why isn't Orderless an Attribute of And?

In standard logic And is a commutative operator. Still, in Mathematica, And doesn't have the ...