how can you figure out how to do a fractal triangle. how do you figure out how write the expression?

Since this is not my area of expertise, I searched Google under the key words "fractal triangle" to get these possible sources:

http://serendip.brynmawr.edu/playground/sierpinski.html
http://math.rice.edu/~lanius/fractals/
http://ejad.best.vwh.net/java/fractals/sierpinski.shtml
http://www.htdp.org/2001-01-18/Book/node143.htm
(Broken Link Removed)

I hope this helps. Thanks for asking.

Dillon, PsyDAG gave some pretty good references for this subject. Generally, the equation of fractals involves infinite series. I'm not sure if this is a subject your familiar with yet or not, but fractals and infinite series would not typically be covered until an advanced calculus course. You might get an intro to infinite series in a high school course or first year calc sequence.
If you want to see another example of fractal triangles, google: Koch curve. This is also called the snowflake curve. This is the simplest example I can think of of a function that is continuous, but nowhere differentiable. There should be a Wik entry for it.

To create a fractal triangle, you can use a mathematical concept called the Sierpinski Triangle. This fractal is created by repeatedly dividing an equilateral triangle into four smaller triangles and removing the middle triangle, then recursively applying the same process to the remaining three triangles.

To write the expression for the Sierpinski Triangle, you can use a recursive function or an iterative approach. Let's go through both methods:

1. Recursive Function:
Start by defining a function that draws a triangle. You can use a graphing software or programming language like Python to visualize the triangle. Here's an example using Python and the turtle graphics library:

```python
import turtle

def draw_triangle(length):
for _ in range(3):
turtle.forward(length)
turtle.left(120)

def draw_sierpinski(length, depth):
if depth == 0:
draw_triangle(length)
else:
draw_sierpinski(length / 2, depth - 1)
turtle.forward(length / 2)
draw_sierpinski(length / 2, depth - 1)
turtle.backward(length / 2)
turtle.left(60)
turtle.forward(length / 2)
turtle.right(60)
draw_sierpinski(length / 2, depth - 1)
turtle.left(60)
turtle.backward(length / 2)
turtle.right(60)

turtle.speed(0) # Speed up the drawing process
draw_sierpinski(200, 4) # Adjust the length and depth according to your preference
turtle.done()
```

In the `draw_sierpinski` function, we first check if `depth` is zero. If it is, we draw a triangle using the `draw_triangle` function. Otherwise, we recursively call `draw_sierpinski` with half the length and decreased depth, and then move the turtle appropriately to draw the remaining triangles.

2. Iterative Approach:
If you prefer an iterative approach, you can use a loop to gradually build up the fractal. Here's an example using Python:

```python
def draw_sierpinski_iter(length, depth):
turtle.penup()
turtle.goto(-length/2, -length/(2 * 3**0.5))
turtle.pendown()
for _ in range(depth):
step = length / 2**_
for _ in range(3**_):
for _ in range(3):
draw_triangle(step)
turtle.forward(step)
turtle.left(120)
turtle.forward(step)
turtle.left(120)
turtle.penup()
turtle.backward(step)
turtle.pendown()

turtle.speed(0)
draw_sierpinski_iter(200, 4)
turtle.done()
```

In the `draw_sierpinski_iter` function, we initialize the turtle's position to the bottom left corner of the largest triangle, then use nested loops to draw each level of the fractal.

Both methods, recursive and iterative, will produce a fractal triangle known as the Sierpinski Triangle. The `length` parameter controls the size of the initial triangle, and the `depth` parameter determines the number of iterations or levels in the fractal. You can adjust these values to create different variations of the fractal.