Forgot to say thanks for the help with the linear algebra last week kgtrep, really appreciate it![]()
No problem. Glad I could help.
Forgot to say thanks for the help with the linear algebra last week kgtrep, really appreciate it![]()
how do I integreate y' = cos(x) * exp(2sin(x)) ? I know the solution but step by step I don't know how to get there.
solution: y = 1/2 exp(2sin(x)) + c
How would I take the Laplace transform of a step function?
f(t) = 1 for 1<t<3
0 everywhere else.
Need F(s)
Cheers for the help boviscophobic, I ended up using your method for the first q, and I did use the completeness axiom in the second so I presume I was at least some way towards being correct!
Is it alright if I ask a matlab question here? I'm trying to write a script where I can calculate the sum of a series until the difference between successive terms is less than 10^-4.
The sum is a Bessel function, and then the question also asks that J'(1) is given to the same degree of accuracy using matlab and the power series. I used a fact earlier in the question ("You may use the result that a power series can be differentiated term by
term within its radius of convergence") to solve a differential equation involing J' and J'' but I'm not sure quite what to do here.. any help appreciated![]()
I'm pretty sure by the pigeonhole principle that it is impossible to always be able to get it down to one. I.e. There must always be at least two numbers that gave the same answer to he questions. Keep trying though.
Not a real edit: Although if the question doesn't always require an answer I.e if the number is greater than 14 answer yes, if less than 7 answer no. This will split into three parts, but again I don't know if this would count.
Would anyone be able to help with a simple probability question?
The question is this:
The universal set contains these numbers:
U = {0, 1, 2, 3, ..., 20}
What are three "yes or no" type questions that would give the best chance of guessing a number randomly picked from the universal set? The questions must not directly relate to each other, that is, the questions could be asked in any order and still give the same answer.
Two questions that I think should be used are:
"Is the number even?"
and
"Is the number greater than 9 (or 10, just trying to split the range)?"
My teacher said that a student has come up with questions that narrowed it down to exactly one, but it should be easy to get it down to 2 or 3. The problem is the third question, assuming my first two are a good starting point. Because the unit we are doing is Set Theory, I figured something like this would work:
"Is the number part of set A, where A = {0, 1, 2, 4, 5, 9, 10, 11, 12, 13, 14}?"
Because if the number is odd, not greater than 9, and part of set A, it will either be 1, 5, or 9. If it isn't part of set A, it will be 3 or 7. If it is even, not greater than 9, and part of set A, it will be 0, 2, or 4. If it isn't part of set A, it will be 6 or 8. If it is odd, greater than 9, and part of set A, it will be 11 or 13. If it isn't part of set A, it will be 15, 17, or 19. If it is even, greater than 9, and part of set A, it will be 10, 12, or 14. If isn't part of set A, it will be 16, 18, or 20.
So these three questions will give me chances of either 1/3 or 1/2. I would then have to guess the number that it is (33% or 50% chance) for the bonus mark that this is worth. But, because he said it is possible to narrow it down to one possible number, how?
The teacher said a student came up with a series of really complicated questions and managed to get it down to 1.
The contradiction above is assuming that we always ask the questions in the same order. If the order must not matter, wouldn't that require even more questions to uniquely represent each number? Say, with three questions, the answers 001, 010, and 100 could represent three different numbers before. Now, only one number can be represented by these three answers.
The best case scenario for a binary question is a bifurcation of the set (so you're implementing a binary search). This reduces the cardinality of the set by half all of the time. You have invented three questions that do so--congrats, you have an ideal solution--but an easier way to do so would be to ask: "Is the number in the first half of the set?" three times (alt: "Is the number at or below the set's median?"). With 21 items in the original set, the best you can do is reduce the set into 8 partitioned subsets with mean cardinality of 2.625. It would take 4.39 questions (IE 5 questions) to identify the numbers with certainty.
If you need to convince yourself of this, consider an alternative problem and a degenerate case:
U = {0, 1, 2}
You have one question. How likely are you to get the right answer assuming you ask the optimal possible question? You can't do better than 2/3rds, which you get by asking a question that has a 1/3rd chance of isolating the item and a 2/3rds chance of eliminating one item (thus giving you a 1/2 chance of getting it right).
One other way to look at this. Draw a Venn diagram with three circles: A, B, and C referring to your first, second, and third questions. The only way you could guess the number correctly 100% of the time is if you can come up with an arrangement of the circles such that there are 21 regions in the venn diagram. It should be obvious that the best you can do is 8 (Not A & Not B & Not C; Not A & Not B & C; Not A & B & Not C; Not A & B & C; A & ...)
One final way to do this. Write the numbers from 0 to 21 as rows of a table with no columns. Each question you ask adds a column to the table (say the question "Is it even?" adds a column marked "Evenness"). Imagine you code Yes as "Y" and No as "N" or Yes as "1" and No as "0". After three questions, what are the possible values of a row? YYY, YYN, YNY, YNN, NYY, NYN, NNY, NNN. In order to identify every row with certainty, you need 21 possible row profiles. You have 8.
The number of binary questions it takes to solve a problem like this with certainty is log(|U|)/log(2). If you could ask trinary questions (questions that have three distinct answers), the number of questions it takes to solve the problem would be log(|U|)/log(3) = 2.77--so you'd be able to solve it for sure in 3. FortuneFaded's answer is a trinary question. The answers are not "yes" and "no", but 2, 1, and 0 where 0 is coded as no, 2 is coded as yes, and 1 is coded as silence. Riddles aren't math, honestly, and your prof is a bum if he asked the question in this form and this is the answer he wanted. If you are allowed to ask such questions, then your question should be "If your number is in the last third of the remaining subset, say yes; if it is in the first third, say no." asked three times. You might also ask "Say yes a number of times equal to your number or no if your number is 0" and you can get the answer in one question. And then hopefully slap him in the face with a trout.
You'd also be able to optimize if the number was not drawn randomly (IE the distribution of the number drawn from the set was non-uniform) because you'd be able to ask questions that are more useful for the more likely cases even if they're less useful for the less likely cases. Either your professor was trolling you or you misunderstood something about the question or the professor's revelation about your classmate's answer.
If the problem was "What are the questions you could ask such that there exists some number in the set which you can guess with certainty?" then it only takes one question and the question is "Is the number 0?". But by definition, questions which can eliminate more numbers have less likelihood to do so and questions which eliminate fewer numbers have greater likelihood of doing so.
This is a major class of problems in machine learning--decision tree problems. Here is an algorithm used to solve those problems by minimizing entropy ("randomness")--and thus maximizing certainty:
http://en.wikipedia.org/wiki/ID3_algorithm
Or if that's too complicated:
https://sciencemagician.wordpress.com/2014/10/17/guess-who-winning-strategies/
I don't think that is possible, and would like to hear back what three questions that student used.
The problem is that there are 21 numbers, and we can think of the answer to each yes/no question (no matter how complicated they are) as a bit 0 or 1. To uniquely cover 21 numbers, we would need 5 bits, or 5 yes/no questions.
The contradiction above is assuming that we always ask the questions in the same order. If the order must not matter, wouldn't that require even more questions to uniquely represent each number? Say, with three questions, the answers 001, 010, and 100 could represent three different numbers before. Now, only one number can be represented by these three answers.
As an aside, your problem reminded me of Hamming code. There, we can use 7 yes/no questions to find the number between 0 and 15, and to even tell if one of the seven answers was a lie and when that occurred.
14:52 Nirolak "My teacher said that a student has come up with questions that narrowed it down to exactly one" <- "May I see the answer key?"
14:52 stump Nirolak: that question doesn't work, if he answers no you've gained no knowledge
14:54 stump The guy proposed a trinary question, exploiting the fact that a yes/no question is typically seen as a binary question, but in fact could be a trinary question if you include silence.
14:55 stump Nirolak: "Say yes N times where N is your number, or say No if your number is 0"
14:55 Nirolak yeah that kind of thing works
14:55 stump that "question" doesn't even require silence
14:56 Nirolak but if "No" is a refusal to answer the question instead of an answer to the question you could get the wrong number
14:56 stump Nirolak: that's true for the guy's trinary question too
14:56 Gotchaye say yes n+1 times
14:56 stump Gotchaye: lol
14:56 stump math destroyed
You're otherwise right, but this is not the implication.
Imagine we have a group of four people, and we want to uniquely identify the people using two questions ("Is it a male?" "Is it an adult?"):
Dad, Mom, Son, and Daughter.
Dad 11
Mom 01
Son 10
Daughter 00
Your idea is that if we have to be able to ask the questions in any order, it is impossible to tell Mom and Son apart, and yet no matter which order you ask the questions in you can tell Mom and Son apart. Your error is that you assume that because "01" would be "10" if you vary the order, you can't tell them apart--IE you can't backwards deduce the identity of the person from the binary. But that's not the constraint on this question. You have to be able to ask the questions in any order, but you know which order they were asked in.
Wow, this is a very informative reply, thanks! I am only in grade 12, and we are only four days into the course, which is Mathematics of Data Management, so some of your answer is a bit complicated for me. I see what you mean by the ways of finding out the minimum number of questions, and that the questions I came up with were more complicated than needed.
Q1 Q2 Q3
0 N N N
1 N N Y
2 N Y N
3 N Y Y
4 Y N N
5 Y N Y
6 Y Y N
7 Y Y Y
8 ? ? ?
Your error is that you assume that because "01" would be "10" if you vary the order, you can't tell them apart.
Ah, my bad. But even if know the order, we would still need to ask 5 questions if we want to always guess the number correctly, right?
I'm really sorry. I assumed it was a mid-level university course and responded as though you understood a bunch of stuff about probability that are clearly above your level. I did ID-3 in 4th year university Artificial Intelligence. Sorry!
Let me make it simple:
Your questions are the best possible real, non-cheating, non-phony questions you could ask for this problem. They are the best because each time they come as close as possible to splitting the set in half. Good job, you're ahead of most college students.
Here's a proof for why what your professor said was wrong--unless it's a troll situation like we talked about above with the yes/no/silence questions or the multi-question questions--Imagine we have three questions, Q1, Q2, and Q3. We don't know what the questions are, but don't worry about that right now. Imagine that the set of numbers is not 0... 21, but rather 0... 8. So you only have 9 numbers to deal with. Wow, that's a much easier problem. Imagine that we ask these three mystery questions (again, it doesn't matter what the questions are), and we get a set of answers. Now, we've designed our questions so that each possible number has a distinct answer, right? So maybe our table looks like this:
Code:Q1 Q2 Q3 0 N N N 1 N N Y 2 N Y N 3 N Y Y 4 Y N N 5 Y N Y 6 Y Y N 7 Y Y Y 8 ? ? ?
Okay, what if your prof picked number 8. What possible answers could he give you for the three questions that would not be the same answers as one of the other numbers?
(It's a trick question--any combination of answers he gives you would make you have to guess between 8 and another number!)
(My proof is the answer kgtrep gave you BTW. Imagine all the Ns are 0s and the Ys are 1s and then read the table as binary numbers! 0=0, 1=1, 2=2, 3=3. 8 would have be represented as 8 which takes four binary digits 1000! You can't fit the number 8 in the three binary digits!)
Ah, my bad. But even if know the order, we would still need to ask 5 questions if we want to always guess the number correctly, right?
As for the original problem, Namikaze, my guess for the optimal strategy is what you had said: go with a 1/3 or 1/2 chance, and play safe.![]()
A) What is the probability that none contain high levels of contamination?
B) What is the probability that exactly one contains high levels of contamination?
C) What is the probability that at least one contains high levels of contamination?
I've got a stat question; I'm given that the probability of a specimen having high levels of contamination is 0.10. So 0.90 that it's fine, righto. Five samples are checked, and they're all independent.
0.9 ^ 5 = 0.59, which is correct
My thought is (0.9 ^ 4) * 0.1 = 0.065, which is wrong, the answer is 0.328.
Any ideas what I should be doing instead? Then there's also C.
I'm not sure how to tackle these problems, and any pointers that can be given would be appreciated.
EDIT: Multiplying my answer for B * 5 gives me the answer, but I'm not sure I really get why I'm supposed to be doing that. Could anyone explain the logic?
I've got a stat question; I'm given that the probability of a specimen having high levels of contamination is 0.10. So 0.90 that it's fine, righto. Five samples are checked, and they're all independent.
0.9 ^ 5 = 0.59, which is correct
My thought is (0.9 ^ 4) * 0.1 = 0.065, which is wrong, the answer is 0.328.
Any ideas what I should be doing instead? Then there's also C.
I'm not sure how to tackle these problems, and any pointers that can be given would be appreciated.
EDIT: Multiplying my answer for B * 5 gives me the answer, but I'm not sure I really get why I'm supposed to be doing that. Could anyone explain the logic?
I've got a stat question; I'm given that the probability of a specimen having high levels of contamination is 0.10. So 0.90 that it's fine, righto. Five samples are checked, and they're all independent.
0.9 ^ 5 = 0.59, which is correct
My thought is (0.9 ^ 4) * 0.1 = 0.065, which is wrong, the answer is 0.328.
Any ideas what I should be doing instead? Then there's also C.
I'm not sure how to tackle these problems, and any pointers that can be given would be appreciated.
EDIT: Multiplying my answer for B * 5 gives me the answer, but I'm not sure I really get why I'm supposed to be doing that. Could anyone explain the logic?
I've got a stat question; I'm given that the probability of a specimen having high levels of contamination is 0.10. So 0.90 that it's fine, righto. Five samples are checked, and they're all independent.
B) What is the probability that exactly one contains high levels of contamination?
C) What is the probability that at least one contains high levels of contamination?
I love you all, and I dearly wish I knew about this thread last semester. Or better, was actually good enough to help others instead of just asking for help ._.
The first two explanations definitely nailed question B at a conceptual level, but the second two were great for helping me understand what I was doing at a mathematical level. The formula provided helps explain a great deal, as all my textbook gave me was this:
![]()
Especially C; that one made little sense to me as to how to approach it but seeing the logic/math being put into it helps a great deal. Thank you, all of you.
Can anyone help me out integrating this function?
![]()
I'm using parts by integration but the second integration I must do is
![]()
and I can't figure out how to integrate this and I'm stuck. I know it has something to do with arctan but I don't know what to do with that x^3.
Why did you link to a nintendo thread for u sub? lolu substitution
d/dx sin(x) = cos(x)
u = 2sin(x)
du = 2cos(x)
cos(x) = 1/2 du
so: y' = 1/2 e^(u)du
y = 1/2 int(e^(u)du) = 1/2 e^u + C
replace u:
y = 1/2 e^(2sinx) + C
Why did you link to a nintendo thread for u sub? lol
The first two explanations definitely nailed question B at a conceptual level, but the second two were great for helping me understand what I was doing at a mathematical level.
Has anybody seen a good mathematical formula wallpaper for computers? I basically want a bunch of readable formulas, mainly calculus related, at a high resolution for my laptop. That way whenever I forget a formula, I can just look at my desktop to find them. I figured it would be a good way to practice it as well.
I can't see your image, but I'm assuming your textbook doesn't give you those formulae? That's insane. You should pick up another to supplement it (a used and cheap one, that is).
There are a lot of formulas that I understand the proofs of and can simply re-derive with the proofs if I need to do so. But there are a lot of formulas that simply have proofs that are far too complicated and it's worth simply memorizing. I've seen the proof for the quadratic formula, and I understand it. But it's a lot easier to simply memorize it than constantly referring to the proof. A clean high resolution wallpaper with a lot of the essential formulas would be a lot more useful to me than a pretty picture. It would give me something to quickly look at during dead time on the computer too. I might put some work into this and see what I can come up with. The only problem is that I'm likely going to need to constantly add new formulas, so I'll need to keep up with a project with dozens of layers.Yay, I'm praised in both. Haha, I'm just kidding around. I came here only recently, so I gotta thank all the GAFers who made this thread alive and positive. This thread made me realize I miss tutoring math.
I don't think that's a good idea, cause I think it's more important to understand the concepts behind calculus than to memorize formulas for differentiation and integration. When I forget a formula, I just look it up on the web or in a book, or derive it myself if I know what should be done (the concept).
You can find pocket books that only list such formulas--hundreds and hundreds of them--cause they were useful to someone at some point in history (they must have been), but these books are so boring to look at, that I wouldn't want to do that to my desktop.
There are a lot of formulas that I understand the proofs of and can simply re-derive with the proofs if I need to do so. But there are a lot of formulas that simply have proofs that are far too complicated and it's worth simply memorizing. I've seen the proof for the quadratic formula, and I understand it. But it's a lot easier to simply memorize it than constantly referring to the proof. A clean high resolution wallpaper with a lot of the essential formulas would be a lot more useful to me than a pretty picture. It would give me something to quickly look at during dead time on the computer too. I might put some work into this and see what I can come up with. The only problem is that I'm likely going to need to constantly add new formulas, so I'll need to keep up with a project with dozens of layers.
Alright, so an update on my probability problem seen on this page. My teacher said that trick questions such as him saying no or yes a number of times equal to the number is not allowed, and he is also not allowed to not say anything, so an answer has to be either "yes" or "no". From this, I told him it would be impossible for someone to narrow it down to 1 number. Well, there is a way, but not a very pleasing one. He said the first question could be "Is it less than 10", and then the second being "Is it less than 5", with the final question being "Is it 3" and if the number is 3, or whatever you said for the question, then the three questions did narrow it down to 1 number. Of course, if the number is greater than or equal to 5, this screws up the whole thing.
Alright, so an update on my probability problem seen on this page. My teacher said that trick questions such as him saying no or yes a number of times equal to the number is not allowed, and he is also not allowed to not say anything, so an answer has to be either "yes" or "no". From this, I told him it would be impossible for someone to narrow it down to 1 number. Well, there is a way, but not a very pleasing one. He said the first question could be "Is it less than 10", and then the second being "Is it less than 5", with the final question being "Is it 3" and if the number is 3, or whatever you said for the question, then the three questions did narrow it down to 1 number. Of course, if the number is greater than or equal to 5, this screws up the whole thing.
That doesn't make any sense (not attacking you, just the proposed answer). By the same token, if I asked "is it 3?" on the first question and happened to be right, then I have narrowed it down to one number with one question. Better yet, my state of correctness doesn't depend on actually asking the question. So I can merely contemplate the number 3, and if that happens to be the correct number, then I have narrowed it down to one number with zero questions.
Also, those questions are heavily implied to be dependent on each other. Presumably if the answer to question 1 were that the number is greater than 10, you would not then proceed to ask if it is less than 5. Conclusion: I call shenanigans.
Your teacher is advising you incorrectly; the questions he is advising you to ask do not maximize your probability of getting it right or the average set size. The questions he gives you give you the following probability of being right:
Number is 0-2 or 4: 1/4
Number is 3: 100%
Number is 5-10: 1/6
Number is 10-20: 1/12
(EV--expected value AKA overall chance of getting it right: 1/4*4/21 + 1/1*1/21 + 1/6*6/21 + 1/12*12/21 = 4/21)
Moreover, the order of the questions matters. He has you asking questions that are literally useless if the answer to the first question is "No". Why would you ask "Is it less than 5?" if it's not less than 10. You would only ever ask the questions in the order given.
If you want to be able to guess it when the number is 3, you could ask "is the number 1?" "Is the number 2?" "Is the number 3?", which gives you a 100% chance if the number is 1-3, and a 1/18 chance elsewhere (4/21 overall probability--same probability of being correct as your teacher's dumb questions). But we ignore the 1/18 chance because ????? reasons ????? If the objective is to get three questions that can identify one particular number with certainty then his questions are fine but so are any boneheaded questions. As boviscopophobic mentions, you needn't ask any questions at all--you can simply guess 3 every time and be right.
Your initial proposed questions were the best you could do. Using your initial questions (or my proposed questions--or any set of optimal questions) you get a 1/3*15/21 + 1/2*6/21 = 8/21 chance of getting the number right.
Really disappointed that that's the outcome in the end.
Boo. Like boviscopophobic and Stumpokapow said already, that's not a good answer; it certainly doesn't disprove your stance that there's no way to narrow it down to one number with three questions.
I think your teacher was trying to illustrate binary search algorithm, but ended up badly phrasing the problem and violating his own rules. No need to feel bad about this, Namikaze.
So we're being taught that a linear search of an array has the average runtime of n/2, n being the number of elements in an array. But shouldn't it really be (n+1)/2?
If you have an array with 1 element, it will take an average of 1 runs to find the element, which is (1+1)/2 = 1
if you have an array with 5 elements, you can find the average by adding the numbers and dividing by 5. So (1 + 2 + 3 + 4 + 5)/5 = 3 and (5+1)/2 = 3.
This holds true for all n.
So why are we being taught it is n/2 when it is (n+1)/2?
I understand that, but I just find it strange that both the book and the professor ignore that explanation. They simply say on average, it will take n/2 passes to find the element. They don't put it in a context of a large n.Because no one cares about the +1. Most of the time people will only talk about an algorithm as running in something like Otime, which means it takes an amount of time proportional to n - we don't even really care about the 2.
This analysis is of interest when you're talking about very large n. You have some huge list that you want to search, and it has particular properties, so what search algorithm do you use? When n gets big enough an algorithm that takes time of the form an+b will be faster than one that takes time of the form cn^2 + d, no matter what the four constants are.
For small n this isn't very useful, but the whole idea of analyzing only the repeating steps of the search algorithm doesn't make much sense for small n - you've got to consider not just how many comparisons you're making but also any one-time prep work you have to do before starting the main search.
I understand that, but I just find it strange that both the book and the professor ignore that explanation. They simply say on average, it will take n/2 passes to find the element. They don't put it in a context of a large n.
Because no one cares about the +1. Most of the time people will only talk about an algorithm as running in something like Otime, which means it takes an amount of time proportional to n - we don't even really care about the 2.
This analysis is of interest when you're talking about very large n. You have some huge list that you want to search, and it has particular properties, so what search algorithm do you use? When n gets big enough an algorithm that takes time of the form an+b will be faster than one that takes time of the form cn^2 + d, no matter what the four constants are.
So, the properties of set algebra are similar to the properties of regular algebra. Commutative and associative laws are trivial--they're only laws in order to formalize them, no one would ever assume anything to the contrary. a+b = b+a, AuB=BuA. a+b+c=a+(b+c)=(a+b)+c. Au(BuC)=(AuB)uC=Bu(AuC). Commutative laws do NOT work for division. Associative laws don't work for subtraction or division.
Distributive laws you can remember by knowing that you're "distributing" the outside over each term of the inside. The same is true for multiplication into addition. A*(B+C) = (A*B)+(A*C). Au(BnC) = (AuB)n(AuC).
And then there's the properties of these operations that don't have obvious numeric algebra equivalents. De Morgan's laws there's nothing tough going on, just know that when you're distributing a complement operator you flip unions into intersections and vice versa. (AuB)^C = A^C n B^C. (AnB)^C = A^C u B^C.
The rest are pretty trivial. A^C^C = A. Anything u U = U. Anything n U = Anything. Anything u 0 = Anything. Anything n 0 = 0. Anything u Itself^C = U. Anything n Itself^C = 0. Basically union of two things is going to "grow" the set, intersection of two things is going to "shrink" the set. A n A = A. Thinking in terms of Venn Diagrams will help with anything interacting with the universal or null sets. In a Venn diagram, union looks like addition and intersect looks like ... not quite subtraction, but shrinking.
I'm not sure if you've covered partitions since I didn't do set algebra in high school, but one of the most useful conclusions of set algebra is the partition: A = (AnB)u(AnB^C) -- you can derive this using the above properties. This is extremely important, but I'm not sure if your class is covering them.
I would definitely recommend practicing problems until you have this stuff down pat, because subsequent topics--first-order and propositional logic especially--are going to build on this a lot. Last year I went through the notes from Intro CS Discrete Math which I took maybe 12 years ago now, and looking at some of the longer propositional logic proofs, I found them very very hard to read. It felt so foreign. So practice and keeping it fresh in your mind are key to be able to work through the problems quickly and effectively.
Even without the context of a large n, as n grows, the distinction between n/2 and (n+1)/2 shrinks to a vanishingly small factor pretty quickly. At n=100, the difference between 50 and 50.5 is 0.5% of the overall time cost. At n=1000, you're at 0.05%.
This is pretty observable just by plugging a value into n. Let n equal 1000000
1 Class:
1 = 1
Log N class:
logn = 6
log(n+1) = 6
log(n+10) = 6
log(3n) = 6.4
log+1 = 7
log+10 = 16
3log= 18
N class
n: 1000000
n+1: 1000001
n+10: 1000010
3n = 3000000
N log N class
nlogn = 6000000
nlogn+1 = 6000001
nlogn+10 = 6000010
3nlogn = 18000000
N^2 class
n^2 = 1000000000000
n^2 + 1 = 1000000000001
n^2 + 10 = 1000000000010
3n^2 = 3000000000000
2^N class
2^n = Google won't even calculate this.
Alternative, graph any of these and watch as the classes diverge while the intra-class deviation stays more tightly bounded.
I guess the only other thing that is confusing is De Morgan's laws. Is there an intuitive way of explaining why unions turn into intersections, and vice-versa? I can obviously prove it by finding the answer both ways, but it just seems weird for it to happen.
A B A or B A and B A^C B^C (A or B)^C (A^C and B^C) (A and B)^C (A^C or B^C)
0 0 0 0 1 1 1 1 1 1
0 1 1 0 1 0 0 0 1 1
1 0 1 0 0 1 0 0 1 1
1 1 1 1 0 0 0 0 0 0
Two strategies:
1. Venn Diagrams -- these will teach you spatially about "what" is going on when you do these operations.
Draw two circles overlapping each other inside a BIIIIG rectangle. The left circle is A. The right circle is B. The big rectangle is U, the universal set. Colour the left circle, say, blue, and the right circle, say, red. So the overlapping section is red and blue ("purple"), right? That's A n B. Now imagine all the blue, purple, and red area is coloured green. That's A u B.
The section that's both red and blue is (A n B), right, we just said that? That's the definition of an intersection. Okay, now you want to take the complement of that. Now do another copy of your drawing, but don't colour anything. I want you to colour everything inside the whole box that's not purple. So that's all the just-red section, all the just-blue section, and all the section outside the circles. That's (A n B)^C
Now draw another copy of the drawing, no colouring. Colour in EVERYTHING outside the left circle red. So that's the whole part outside the two circles + the part of the right circle that doesn't overlap the left circle, right? That's A^C. Now colour in EVERYTHING outside the right circle blue. That's B^C. So that's all of the area outside both circles + the area of the left circle that doesn't overlap the right circle. We know from above, that the union is the area coloured blue, the area coloured purple, and the area coloured red. What's that area? (Hint: It's everything except the middle overlapping chunk).
That's the not-and form of DeMorgan's law. You can do the other one yourself.
2. Binary Variables.
You can also treat it as binary.. A and B are variables that can be 1 or 0. "A and B" means "Are both A and B equal to 1". "A or B" means "Are either A or B or both equal to 1?". "A^C" means "The opposite of A: if it's 1, give me a 0. If it's 0, give me a 1."
Here you can see the last two columns are the not-And form of De Morgan's laws, and the two before it are the not-Or form of De Morgan's laws.Code:A B A or B A and B A^C B^C (A or B)^C (A^C and B^C) (A and B)^C (A^C or B^C) 0 0 0 0 1 1 1 1 1 1 0 1 1 0 1 0 0 0 1 1 1 0 1 0 0 1 0 0 1 1 1 1 1 1 0 0 0 0 0 0
One cool thing is that even if you don't understand why these things are happening, if the functions are equivalent for all possible input values, you know they're the same.