Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
| |
|
|
You are not logged in. #1 2006-02-01 06:43:27
what is discrete math?hope I spelled that right. Heard you take it in 3d game programming. A logarithm is just a misspelled algorithm. #2 2006-02-01 09:26:18
Re: what is discrete math?Discrete math is a compilation of different types of math. My discrete math started off with something like boolean algebra. "In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..." #3 2006-02-01 17:32:16
Re: what is discrete math?Interesting. Thanks for the description. A logarithm is just a misspelled algorithm. #4 2006-02-01 19:25:25
Re: what is discrete math?
Ah, but it does! It holds a binary value, the basis of life as we know it. "The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman #5 2006-02-02 08:37:16
Re: what is discrete math?
Little known fact, most compilers have a bool as 8 bits, even though only one is needed. "In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..." #6 2006-02-02 08:58:17
Re: what is discrete math?Yeah I meant it doesn't store a numerical value for the user. A logarithm is just a misspelled algorithm. #7 2006-02-02 09:31:13
Re: what is discrete math?Does boolean algebra have a distributive property? El que pega primero pega dos veces. #8 2006-02-02 09:34:37
Re: what is discrete math?like in C++? Last edited by mikau (2006-02-02 09:34:52) A logarithm is just a misspelled algorithm. #9 2006-02-02 09:43:01
Re: what is discrete math?Well, PHP. I've never written a line of C++, and hope I never have to. El que pega primero pega dos veces. #10 2006-02-02 09:46:21
Re: what is discrete math?Its not that hard to use once you know it. But it can very hard to learn sometimes. A logarithm is just a misspelled algorithm. #11 2006-02-02 09:56:08
Re: what is discrete math?
Not quite. There is no equality in boolean algebra. Instead, each variable is either true or false. "In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..." #12 2006-02-02 09:59:13
Re: what is discrete math?
This is a bit of a complex question (pun intended). Computers run much faster if all data is stored in whole bytes. To understand why, you need to understand the underlying architecture, which would take me a while to describe. "In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..." #13 2006-02-02 10:00:45
Re: what is discrete math?Heh, I think exactly opposite. My first programming language was C at age 13. My first OOP language was Java at age 18. Both were very easy to learn, but using Java is much easier. This is mainly due to Java's memory handling and extensive API. And after using a language that abstracts strings, I just can't bring myself to use a language that doesn't (of course, I'm sure people have abstracted strings tons of times in C++, but I doubt it's as slick as native support). El que pega primero pega dos veces. #14 2006-02-02 10:13:23
Re: what is discrete math?Well in the case of C++, there are I believe three logical operators, And "&&" Or, "||" and Not "!" A logarithm is just a misspelled algorithm. #15 2006-02-03 05:08:46
Re: what is discrete math?OK. Too right. El que pega primero pega dos veces. #16 2006-02-03 05:22:04
Re: what is discrete math?maybe there is. Many computer languages hold secret techniques only known by the ninja's. A logarithm is just a misspelled algorithm. #17 2006-02-03 07:29:17
Re: what is discrete math?
Isn't that the "select" statement (aso called "case" or "switch") ? Code: Select Case c
Case "a" To "z", "A" To "Z", "0" To "9"
Mid$(x, i, 1) = c
Case Else
Mid$(x, i, 1) = "_"
End SelectI chose VB because it has such a rich case statement, PHP can only have one value per "case": Code: switch ($MatchType) {
case "=":
$s .= $MatchVar . "=" . $MatchVal;
break;
case "Like":
$s .= $MatchVar . ' like "%' . $MatchVal . '%"';
break;
default:
$s .= $MatchVar . $MatchVal; break;
}But PHP, like C, will continue to run statements below it without the "break;", so this can be used to put several "case" statments in sequence: Code: switch ($MatchType) {
case "=":
case "equal":
case "same":
$s .= $MatchVar . "=" . $MatchVal;
break;
case "Like":
$s .= $MatchVar . ' like "%' . $MatchVal . '%"';
break;
default:
$s .= $MatchVar . $MatchVal; break;
}But there is a trick in PHP: use switch (TRUE) and then the "case"s can be conditions like "($x >5)" or "in_array()" etc. "The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman #18 2006-02-03 10:26:30
Re: what is discrete math?Hmm...case true eh? Pretty slick. I had thought of the rollover switch, but it seems like using a sledgehammer to open a can. Almost easier to just use a knife. But what I really need is a can opener... El que pega primero pega dos veces. #19 2006-02-03 19:13:02
Re: what is discrete math?Code:canopener ($problem) {
$result = solved;
}"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman #20 2006-02-04 08:03:26
Re: what is discrete math?Code:<?php
function canOpener ($can) {
$canOpened = false;
$args = func_get_args();
unset ($args[0]); //that's $can; we have that one
foreach ($args as $compareTo) {
if ($can == $compareTo) { $canOpened = true; }
}
return $canOpened;
}
?>:p El que pega primero pega dos veces. #21 2006-02-05 02:24:29
Re: what is discrete math?Also on the topic of discrete math for electronics is Karnaugh mapping created in 1950's. Imagine for a moment that even an earthworm may possess a love of self and a love of others. |