Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → Math-sasi... first time I needed you...
12
Math-sasi... first time I needed you...
2007-09-09, 10:53 PM #41
Originally posted by Jon`C:
:gonk:

mzzt, jg: we use binary computers

:headslap:
Code to the left of him, code to the right of him, code in front of him compil'd and thundered. Programm'd at with shot and $SHELL. Boldly he typed and well. Into the jaws of C. Into the mouth of PERL. Debug'd the 0x258.
2007-09-09, 11:18 PM #42
Originally posted by Stormtrooper:
Um, yeah it is right.
There's a dotted line on x = 2 meaning that the value cannot equal 2, but can be everything up to it. It's the same thing as x = [-4,2), just with the y values showing.


does it count as a dotted line if i have to zoom in with mspaint to see it
2007-09-10, 12:30 AM #43
Yes, yes it does
2007-09-10, 12:52 AM #44
Originally posted by Jon`C:
does it count as a dotted line if i have to zoom in with mspaint to see it

Get better glasses/contacts?

Oh, and off your high horse while you're at it.
D E A T H
2007-09-10, 5:54 AM #45
Code:
// its O(1) foo
inline bool IsPow2(int n)
{
   return ( n&(n-1) == 0 );
}




1024:
10000000000
&1111111111 == 0
TRUE


815:
1100101111
&1100101110 == 0
FALSE


953:
1110111001
&1110111000 == 0
FALSE


255:
11111111
&11111110 == 0
FALSE


65536:
10000000000000000
&1111111111111111 == 0
TRUE


512:
1000000000
&111111111 == 0
TRUE


16384:
100000000000000
&11111111111111 == 0
TRUE


15:
1111
&1110 == 0
FALSE
[ B A H ]
Bad *** by nature,
Hackers by choice
2007-09-10, 8:12 AM #46
Ah, binary, that's a clever way to do it.
2007-09-10, 12:18 PM #47
Strike, won't it only be O(1) if n fits in a register?

Since registers tend to be rather small, we have to assume that it won't fit.

I'm imagining it would actually be O(log[sub]2[/sub]n).
Detty. Professional Expert.
Flickr Twitter
2007-09-10, 12:39 PM #48
wow, people aren't as friendly to help as they used to be. So it's easy. Do 10 pages of math and you may get so tired of it the easy stuff stumps you too... or better yet, maybe some people just aren't good at math... sheesh.
Quote Originally Posted by FastGamerr
"hurr hairy guy said my backhair looks dumb hurr hairy guy smash"
2007-09-10, 1:22 PM #49
Why... does this thread still exist? Seriously... DROP IT.
Nothing to see here, move along.
2007-09-10, 1:29 PM #50
We'll drop the thread when you stop telling lies.
2007-09-10, 1:42 PM #51
Originally posted by KOP_AoEJedi:
wow, people aren't as friendly to help as they used to be. So it's easy. Do 10 pages of math and you may get so tired of it the easy stuff stumps you too... or better yet, maybe some people just aren't good at math... sheesh.


No, people ask math/physics related questions time to time, and they get a good answers. It's just when someone who claims to write programs asks a question easy like this, well...people react.
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2007-09-10, 2:33 PM #52
I don't write programs... I script for programs (macro programming I think its called). RC is a 3D game engine, with networking able to support hundreds of players at the same time online (the new servers that were getting this year will be MUCH better than the current ones, which are ok as they are). Its got a pretty easy to use scripting language, and now I know what everyone is *****ing about, and you're absolutely right. I have no idea why I even needed to ask about this. I guess I just couldn't think right last night or something, or I was too tired. Its a common thing to make simple fundamental mistakes when one is tired and burnt out.

I guess that last night I just got a little confused or something because I had gone through 2 pages of pure exponents and powers things, pretty much covering every possible scenario of type of exponent and powers. While I knew how to do most of it, I still had to learn a couple of things on the fly, so I blame exhaustion for yesterdays ignorance. Its so damn clear to me today.
Nothing to see here, move along.
2007-09-10, 3:26 PM #53
Well, what has history taught us about running the gauntlet of Massassi when we're tired?
2007-09-10, 4:03 PM #54
Originally posted by Obi_Kwiet:
Well, what has history taught us about running the gauntlet of Massassi when we're tired?


I will make a comparison of a bull running through a china shop, except the bull was drunk this time.


EDIT: What the hell, that didn't make sense even to me. I better go get some sleep.
Nothing to see here, move along.
2007-09-10, 5:47 PM #55
Originally posted by SF_GoldG_01:
I will make a comparison of a bull running through a china shop, except the bull was drunk this time.



disproved on mythbusters.
"If you watch television news, you will know less about the world than if you just drink gin straight out of the bottle."
--Garrison Keillor
2007-09-10, 5:58 PM #56
Originally posted by Detty:
Strike, won't it only be O(1) if n fits in a register?

Since registers tend to be rather small, we have to assume that it won't fit.

I'm imagining it would actually be O(log[sub]2[/sub]n).


No, it is O(1) because there is always the same number of steps, no matter what the value of n is.
[This message has been edited. Deal with it.]
2007-09-10, 8:07 PM #57
Originally posted by Jon`C:
Here are some numbers.

1024
815
953
255
65536
512
16384
15

Devise an algorithm to determine if a number is a power of two. Show your work. Apply the algorithm to the given numbers. Write a proof for your algorithm and state its computational complexity.


Why you gotta be all up in my grill dawg?

We all know that if you take those numbers, which are somehow base 99, and convert them to binary, and run them into a MIDI sequencer you will get Edwin Starr's "War"

Duh.

Originally posted by fishstickz:
disproved on mythbusters.


Do you think mythbusters would do an ep on Massassi?
Epstein didn't kill himself.
2007-09-10, 8:10 PM #58
Originally posted by Malus:
No, it is O(1) because there is always the same number of steps, no matter what the value of n is.


assuming the number fits into a single register.
2007-09-11, 4:15 PM #59
Originally posted by Jon`C:
assuming the number fits into a single register.

Right, but n is supposed to be an integer in his function, which presumably fits in a single register on modern architectures. I suppose it doesn't really matter.
[This message has been edited. Deal with it.]
2007-09-11, 8:11 PM #60
I like how this thread turned from Gold being an idiot to talking about programing he doesn't understand.
2007-09-11, 8:48 PM #61
Originally posted by Rob:
I like how this thread turned from Gold being an idiot to talking about programing he doesn't understand.


Memo to myself: Call rob a ****ing moron every time he asks a simple question.
Nothing to see here, move along.
2007-09-11, 8:52 PM #62
Or just call him a ****ing moron for no particular reason. It's all good.
"it is time to get a credit card to complete my financial independance" — Tibby, Aug. 2009
2007-09-11, 8:56 PM #63
Originally posted by Freelancer:
Or just call him a ****ing moron for no particular reason. It's all good.


Advice taken.
Nothing to see here, move along.
2007-09-11, 9:40 PM #64
This did not deserve to be closed.

I gave the lot of you the ability to close your own threads ONLY if you state a damn good reason why. These forums are PUBLIC. If you cannot stand public scrutiny and criticism, do not post.
Code to the left of him, code to the right of him, code in front of him compil'd and thundered. Programm'd at with shot and $SHELL. Boldly he typed and well. Into the jaws of C. Into the mouth of PERL. Debug'd the 0x258.
2007-09-11, 9:47 PM #65
I publicly scrutinize your decision to re-open this thread, JG, you toolish admin sort of fellow.
2007-09-11, 9:50 PM #66
Yes, it's re-opened! Celebrate!
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2007-09-11, 9:50 PM #67
Originally posted by Malus:
Right, but n is supposed to be an integer in his function, which presumably fits in a single register on modern architectures. I suppose it doesn't really matter.


well, if it doesn't fit into a register then it has whatever overhead is involved to perform a subtraction using whatever big integer library you're running. it's O(1) assuming the inputs are processed in a uniform manner.
2007-09-11, 10:12 PM #68
Originally posted by JediGandalf:
This did not deserve to be closed.

I gave the lot of you the ability to close your own threads ONLY if you state a damn good reason why.


You kick ***.
"it is time to get a credit card to complete my financial independance" — Tibby, Aug. 2009
2007-09-12, 3:07 PM #69
Originally posted by JediGandalf:
This did not deserve to be closed.

I gave the lot of you the ability to close your own threads ONLY if you state a damn good reason why. These forums are PUBLIC. If you cannot stand public scrutiny and criticism, do not post.


I closed the thread because my problem was solved. If people want to have math fights or whatever, let em do it in their own threads.
Nothing to see here, move along.
2007-09-12, 3:08 PM #70
Originally posted by SF_GoldG_01:
I closed the thread because my problem was solved.

That's not how forums work.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2007-09-12, 3:12 PM #71
Originally posted by Emon:
That's not how forums work.


The thread has been derailed into a math fight, not an answer to a quick question which suddenly became a sword towards me by those who love twisting one words against others for whatever pleasure they get out of it.
Nothing to see here, move along.
2007-09-12, 3:12 PM #72
Originally posted by SF_GoldG_01:
Do you have any idea what its like to learn English in Spanish?


Spanglish? :awesome:
nope.
2007-09-12, 3:17 PM #73
Then move back to the US if you having education problems?
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2007-09-12, 3:19 PM #74
Originally posted by Echoman:
Then move back to the US if you having education problems?


I intend to move back soon. When not sure, but in the immediate future (1-2 years) I will move back.
Nothing to see here, move along.
2007-09-12, 3:22 PM #75
Well, you should do it fast before being left behind (with US standards). There is something terribly wrong when you are doing 8th grade level math this late in your years over there.
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
12

↑ Up to the top!