Jump to content

Random thread

Recommended Posts

When creating a fractal using Geometric shapes, say a cube, you can predict the number of generated cubes with a simple function. Let us say that every time the function loops, the fractal will generate 5 cubes per currently existing cube, with the start of the program beginning with 1 cube. This will happen 5 times. With this knowledge we can employ the function f(n) = c * f(n-1) + 1 where c indicates the number of cubes to make each time the function is called and n determines the current loop number the program is on and 1 indicates the cube we started on. This function will be called 1 time per cube generated during the previous loop.

 

If we start with 1 cube, then we know that f(0) = 1. We want to generate 5 cubes. Our function will look a bit like this:

 

f(5) = 5 * f(5-1) + 1

 

Keep note that to figure this out, we must first know what the previous outputs of the function create, so we need to start with f(1).

 

so if f(0) = 1, then f(1) = 6 I know this because:

 

f(1) = 5 * f(1 - 1) + 1

f(1) = 5 * f(0) + 1

f(1) = (5 * 1) + 1

f(1) = 6

 

from here we can now move to f(2) all the way to f(5). Therefore:

 

f(2) = 5 * f(1) + 1

f(2) = (5 * 6) + 1

f(2) = 31

 

f(3) = 5 * f(2) + 1

f(3) = (5 * 31) + 1

f(3) = 156

 

f(4) = 5 * f(3) + 1

f(4) = (5 * 156) + 1

f(4) = 781

 

f(5) = 5 * f(4) + 1

f(5) = (5 * 781) + 1

f(5) = 3906

 

So a fractal with 5 cubes and 5 iterations will have 3906 cubes in its creation.

 

06-all-children.png

Retired Forum Moderator

Share this post


Link to post

If I had a nickle for every time someone said that, I'd've died of nickle poisoning several times by now.

Don't insult me. I have trained professionals to do that.

Share this post


Link to post

"YOU. NAMEKIAN. TOO STRONG. EXPLAIN NOW."

 

"He fused with Kami."

 

"THE F**K'S A 'KAMI?'"

 

"Basically god."

 

"BUT I'M STILL HERE!"

 

"Do you really believe your own hype that much?"

 

"I AM THE HYPE!!!!"

Retired Forum Moderator

Share this post


Link to post

Come to the dark side, we have cookies... You can't have any, but we still have them.

Don't insult me. I have trained professionals to do that.

Share this post


Link to post
Come to the dark side, we have cookies... You can't have any, but we still have them.

And M&Ms... Those we share.

Don't insult me. I have trained professionals to do that.

Share this post


Link to post

Random thread? Okay, here I go.

I friggin' hate nightmares. Only I would have nightmares of lava being poured down somebody's face and them having to rip their damn face off after it sets. ._. Urghhh... Although I can conclude that sometimes people do wake up and scream from a nightmare. X3

"Ross, this is nothing. WHAT YOU NEED to be playing is S***flinger 5000." - Ross Scott talking about himself.

-------

PM me if you have any questions or concerns! :D

Share this post


Link to post

I came, I saw, I kicked ass!

 

...

 

Aw who am I kidding, I just balled up in a corner and cried until they felt sorry for me and left.

Retired Forum Moderator

Share this post


Link to post
T-t-t-t-t-trumbone player!

You never realize how stupid what you're laughing at is until you laugh at it in the middle of class and people start watching.

the name's riley

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in the community.

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Who's Online   0 Members, 0 Anonymous, 46 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

This website uses cookies, as do most websites since the 90s. By using this site, you consent to cookies. We have to say this or we get in trouble. Learn more.