456 Answered Questions for the topic logic
Swift good coding practice: If statement with optional type Bool?
So I've been developing an app in Swift, and today I spent nearly an hour debugging a problem that turned out to be completely unexpected. It all resulted from the code below.
if (hero.isAI) {...
more
03/18/19
Any way to toggle between two strings using one piece of JavaScript?
I want to do something like
if(something.val() == 'string1')
{
something.val('string2');
}
else if(something.val() == 'string2')
{
something.val('string1')
}
But in one line of code. I...
more
Fastest way of finding the middle value of a triple?
Given is an array of three numeric values and I'd like to know the middle value of the three.
The question is, what is the fastest way of finding the middle of the three?
My approach is this kind...
more
03/18/19
Determine if two strings are similar in Javascript?
Let's say I have two strings, is there any way to check if they are at least 90% similar?
var string1 = "theBoardmeetstoday,tomorrow51";
var string2 = "Board meets today, tomorrow";
Thanks,
Tegan
more
03/18/19
What fallacy in Pascal's Wager allows replacing God with the devil?
I wanted to know the name of the fallacy or fallacies the Pascal's Wager in the sense that it can be applied to motivate one's belief in many things. A similar argument to the original Wager can be...
more
03/18/19
Java method to find the rectangle that is the intersection of two rectangles using only left bottom point, width and height?
I have found the solution but wanted to ensure my logic is the most efficient. I feel that there is a better way. I have the (x,y) coordinate of the bottom left corner, height and width of 2...
more
03/18/19
How to get started with philosophy without getting overwhelmed quickly?
I’ve spent a lot of time trying to find how to get started with philosophy but I can’t. It seems that getting started with computer programming is nothing in comparison - with computer programming...
more
03/18/19
Does Pascal's Wager contain any logical flaws or fallacies?
Blaise Pascal's famous wager was that even if the existence of God cannot be determined through reason, a rational person should wager as though God exists, because living life accordingly has...
more
Find the number of lines in a div?
I want to show 'View All' kind of link, only when the lines in the div has reached 4 lines.
**HTML**
3PAS-Pub-IO-doubleclick.net-LI, ATOM_DFP_Pub_LI, AUG12_Zynga.com_MafiaWars2_0.10$_CPM,
...
more
03/14/19
How to create a method to return 1 or 0 without using conditions?
I was asked a question in an interview to return 1 if provided 0 and return 0 if provided 1 without using conditions i.e if, ternary etc
Just to give you and idea below code without if's:
public...
more
03/14/19
What is the difference between a statement and a proposition?
I'm doing a MOOC on mathematical philosophy and the lecturer drew a distinction between a proposition and a statement. This is very puzzling to me. My background is in math and I regard those two...
more
03/14/19
What is the difference (if any) between "not true" and "false"?
A fairly simple question I hope someone can help me with.
03/14/19
Is circular reasoning always a fallacy?
Suppose the following dialogue: >... >"I accept only one notion of land property. Namely, 'I am doing my stuff here, therefore I am here". >"But this means," he responded, "you can break...
more
03/14/19
How can we reason about "if P then Q" or "P only if Q" statements in propositional logic?
When you have a propositional sentence of the form ***P* ⊃ *Q*** — which we might read as "if *P*, then *Q*" — how can you tell when it is true, or false, based on the truth-values of *P* and *Q*...
more
03/13/19
Is it a fallacy to say that a sane person cannot apply rational thought to the motivations of the insane?
A common argument in today's news is that: 1. Someone commits a heinous crime by shooting a bunch of people. 2. Anyone who commits a heinous crime must be insane. 3. Sane people cannot apply...
more
03/13/19
Can an argument be valid even though one of its premises is false?
Is it possible for an argument to be valid by virtue of its logical form, but contain a false premise? In other words, can a premise be false even though the argument itself is logically valid?
03/13/19
Could 'cogito ergo sum' possibly be false?
I've heard it postulated by some people that *"we can't truly know anything"*. While that does seem to apply to the vast majority of things, I can't see how *'cogito ergo sum'* can possibly be...
more
Logic
03/06/19
If I were your friend and you were my soul mate,then I’d never stop liking you. I’ve stopped liking you. Therefore, I am not your friend or you were not my soul mate.
Determine whether the argument is valid or invalid. You must define your variables, translate each sentence into symbols, complete a truth table, and state whether the argument is valid or invalid.
Logic Probability
03/02/19
Need help answering this question
The serial number on a new twenty-dollar bill consists of two letters followed by nine digits and then a letter. How many different serial numbers are possible, given the following conditions?(a)...
more
How Old Is The Rock?
A certain element has a half life of 4.5 billion years. a. You find a rock containing a mixture of the element and lead. You determine that 35% of the original element remains; the other 65%...
more
Logic
01/16/19
suppse joe and frank have the same amount of money how much must joe give frank so that frank has $10 more than joe
suppse joe and frank have the same amount of money how much must joe give frank so that frank has $10 more than joe
12/22/18
Bonus calculation question (real situation need help)
You will earn bonus of $10,000 tied to company's revenue target of $5m. Payout will start at 90% target achievement with a 50% incentive payout, growing linearly with achievement, with the ability...
more
Logic
12/18/18
Logic puzzle with skirts and blouses
Five girls wearing skirts and blouses in two different colors. Using the information below, you should be able to determine which colors the five had on their clothes. The girls are Anne, Grete,...
more
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.