Euler
geometry
inradius
circumcircle
3D geometry
tetrahedron
inequalities

Is there a Euler triangle formula for 3 dimensions?
Euler's triangle formula says that the distance between the inradius and circumradius is sqrt(R(R-2r)). So if there was a formula for 3 dimensions, it would probably be around the same. Can anyone help me with this?

It would be the Euler tetrahedron formula, wouldn't it?  And a tetrahedron doesn't necessarily have a circumsphere.

blahblahblah: As much as I know every tetrahedron has a circumsphere.

There is a formula like that, but it's much more complicated than the triangle-one. However there is the simple Euler-inequality generalization: in a tetrahedron, if $R$ is the circumradius and $r$ is the inradius, then $R \geq 3r$ ;)


Let $a,b,c \in R^+$ and $abc+a+c=b$
Find the maximum of $P = \frac{2}{a^2+1}-\frac{2}{b^2+1}+\frac{3}{c^2+1}$

I think there is a typo.

Anyway it's a very nice problem, obviously trigonometric substitution is the way to do it, if I am not mistaken.

No, I don't think there is a typo.  ;)

And also, considering $abc+a+c=b$, I can't see any trigonometric substitutions

I believe the numerator of the first term must be 1 but I am not sure anymore, anyways, I have seen it before.

And for the substitution, notice that \[(-a) + b + (-c) = (-a)b(-c),\] does that ring a bell?  :)

What substitution? I don't know...
Is it $\tan A + \tan B + \tan C = \tan A \tan B \tan C$ when $A+B+C = 180$?

Correctly, $\tan x+\tan y+\tan z=\tan x\cdot \tan y\cdot \tan z\Longleftrightarrow (\exists )\ k\in Z, x+y+z=k\pi .$

http://www.mathlinks.ro/Forum/viewtopic.php?t=15707
http://www.mathlinks.ro/Forum/viewtopic.php?t=31782

and there is no typo!

  Darij


group theory
abstract algebra
superior algebra
superior algebra unsolved

[quote="Bob75"]Let $ G$ be a profinite group, $ M$ a normal subgroup of $ G$ such that $ G/M$ is a pro-$ p$-group, $ N$ a subgroup of $ M$ such that $ M/N$ is a pro-$ p$-group.
I want to prove that $ N$ is normal in $ G$ and $ G/N$ is a pro-$ p$-group. Little hint, please, Thanks in advance for your help.[/quote]

Unfortunately it is not true.  Take G to be dihedral of order 8, M to be elementary abelian of order 4, p=2, and N to be a noncentral (in G) subgroup of M of order 2.  Then G/M ≅ M/N ≅ Z/2Z, but N is not normal in G.

[quote="Bob75"]Jack, Thanks you for your answer. I forgot these precisions over $ M$ and $ N$ which have perhaps their importance:
$ G/M$ is the largest quotient of $ G$ which is a pro-$ p$-group and $ M/N$ is the largest quotient of $ M$ which is a pro-$ p$-group.[/quote]

In this case things are much better.  If G/A and G/B are pro-p-groups, then so is G/(A∩B).  Hence M is the intersection of all normal subgroups of G that have pro-p quotients.  Hence M is a characteristic subgroup of G.  More importantly, the comments for (G,M) apply to (M,N) also.  Hence N is a characteristic subgroup of M, and so N is a normal subgroup of G.  Since the extension of a pro-p subgroup by a pro-p subgroup is also pro-p, N must be one of those subgroups that we intersected to get M.  Hence M=N.

Sometimes M is denoted $ O^p(G)$.

So you just need the two lemmas:

1. O^p(G) is a characteristic profinite subgroup of every profinite group G.
2. If G/M and M are pro-p-groups and G is profinite, then G is a pro-p-group.

The first I think is obvious: if O^p(G) exists, it must be uniquely determined up to isomorphism, so must be characteristic.  Alternatively if you know Sylow pro-p-subgroups exist, O^p(G) is the (closed) subgroup generated by all Sylow pro-q-subgroups for q≠p.  This alternative also makes it clear that O^p(O^p(G))=O^p(G) without the need for lemma 2.

The second is obvious for finite groups; I assume it is obvious for profinite groups too.  In Wilson's Profinite Groups book it follows from the index formula |G|=[G:M]*|M|.


[quote="Roland of Gilead"]:D   Joined this forum hoping to seek emotional support with maths.  You see, I'm crap at maths and to become a good programer I need to LIKE maths, but my mind wanders whilst doing maths.... :blush:[/quote]I have the same problem, only that my mind wonders when I programm :P :)

Welcome to the site anyway :D

Hello :P .

http://invisionfree.com/directory.php?go=491280

Just click this link in order to bump my site. You don't even have to visit it :P .

Hey welcome I'm quite new to, but I still like it.  Pm me if you have any questions about the site or math in general... can't really help you in programming, except for on like a TI

Hi i'm Kristy. Welcome to the site! Hope u have a great time!
[url]http://www.xanga.com/kbabe23[/url]

[quote="eryaman"]Hahah, as I read the topic title, I thought someone was making fun of the "I'm full" taco bell commercial  :D[/quote]
now that you mention it, that's exactly what it sounds like.
anywho, being a new member is great. i've changed my name 3 times so i can stay a new member. acutally, i've had screenname difficulties so i have had to start over. whatever.


[quote="Kalle"]Prove that $|\sin u - \sin v| \le |u - v|$ using the formula $\sin u - \sin v = 2\cos\dfrac{u+v}{2}\sin\dfrac{u-v}{2}$ and the inequality $|\sin v| \le |v|$.[/quote]

Using your hints this becomes obvious...... :)

$|\sin u - \sin v|=|2\cos\dfrac{u+v}{2}\sin\dfrac{u-v}{2}|\leq2| \sin\dfrac{u-v}{2}| \le 2|\dfrac{u - v}{2}|=|u - v|$
qed

BTW how do you type "  |  " ??

 :)

[quote="shobber"]Why $|\sin{u}| \leq |u|$?[/quote]

This can be proven by calculus I think.

 :)

[quote="Arne"]Well, there is a better way. Do you see any geometric way to establish this inequality? Think about arc length.[/quote]
I get it now. Thank you very much!


What is the ranking.....in the AoPS forums? What does it mean?

wow, this has been asked too many times.  The more posts you have, the higher your rank goes.  The rank names, like "Birch and Swinnerton Dyer" are millenium problems.

The ranks are:

New Poster: 1-19 posts, 0 stars
P versus NP: 20-49 posts, 1/2 star
Hodge Conjecture: 50-99 posts, 1 star
Poincare Conjecture: 100-249 posts, 2 stars
Riemann Hypothesis: 250-499 posts, 2 1/2 stars
Yang-Mills Theory: 500-999 posts, 3 stars
Navier-Stokes Equations: 1000-2499 posts, 4 stars
Birch and Swinnerton Dyer: 2500+ posts, 5 stars

It shows your senoirity as long as you dont spam!

[quote="robinhe"]Do the names acutally mean anything?

What is P vs. NP (for example)?[/quote]

P vs. NP  is a problem in which scientist haved trying to avoid long combination problems. Ex:

Ur in charge or college residency, and u must choose out of a 400 students, a 100 to be in ur dorms and must also assign them rooms. Yet the Dean gives u a list of all the people who cannot be together in a dorm (considering 2 people stay in 1 dorm). How many possibilities are there??

As u can see there are endless probabilities that are easy to find (P) and check each 1  by  1 OR U can find every bad possibilities which are easy to check (NP) but u have to subtract from all the other possibilities withput overcounting (See Aops 1; under probability combinations, etc. if u don't know what overcounting means)

Thus, there is a conflict on which way can be done without the use of a supercomputer; AKA P. (Easy to find) vs. NP (Easy to check)

[quote="dangvh"]like math92 said, they are millenium problems  :D  so yes, they mean something[/quote]

Sorry, I didn't interpret what math92 said until just now...  :oops:

Do people with higher ranking have [u]any[/u] special abilities or advantages?

Not unless you're so high that they call you a "moderator" or "administrator" (the latter is impractical for most people though..)

Topic locked, and I think I'm going to go crazy the next time someone asks this WITHOUT SEARCHING since there's only about 200 topics on this already.


A group of people gathers for a party. A lot of handshaking goes on. Show that the no. of people who shake hands an odd no. of times are even.

I wonder if this problem is correct or not. The solutions manual for exercises (and not for challenge problems) claims that the problem is true. But when calculated the parity of handshakes vary as two odd and then two even and the sequence continues........  :maybe:   :huh:  :?:   :!:

[hide="Solution?"]
The logic here seems rather shaky to me, so would some one mind pointing out any fallacies?

Suppose there is a handshaking system where this is false. Now, remove one of the people who shook hands an odd number of times. Say he shook hands with $ x$ people who also shook hands with an odd number of people and $ y$ who didn't. Now there are $ 2(n\minus{}1)\minus{}x\plus{}y$. But $ y\minus{}x$ must be odd, so this number is also odd - we can also use this construction process in reverse by choosing suitable $ n,x,y$. So such a system can only exist if there exists a system with one less person so that the problem statement is false. Thus it exists only if such a system with no people so that the problem statement is false exists. However, clearly with zero people the problem statement is true; hence contradiction.[/hide]

[hide="Hint"]Consider the sets of people with an even number of handshakes and an odd number of handshakes.[/hide]
[hide="Solution"]Suppose $ E$ is the set of people who have had an even number of handshakes and $ O$ is the set of people who have had an odd number of handshakes. Let $ h_k$ be the number of handshakes person $ k$ has had. We know that $ \sum_{k \in E}{h_k} \plus{} \sum_{k \in O}{h_k}$ is even because it is twice the number of all handshakes shaken. Since we know that $ \sum_{k \in E}{h_k}$ is even (each person has made an even number of handshakes), $ \sum_{k \in O}{h_k}$ must be even. However, each $ h_k \in O$ is odd, so $ \mid O \mid$ must be even.[/hide]

Please someone post an easy solution as both the solutions are going over my head. I still think the solution can't exist. I can provide a counter example.

Suppose there are 5 people. Then the no. of handshakes that take place are 15 and this is a contradiction.

$ \binom{5}{2}\equal{}10$, so 15 handshakes couldn't possibly take place.

The insight you need to understand the solution is this: if you ask everyone how many hands she shook and add up the answers, you always get an even number.   This is because for every handshake, two people participated.  Once you get this, the solution should be clear.  (akessler just wrote this out with a large amount of notation.)

I know I am an idiot, but I still don't understand it. Here I explain my counter example:

Suppose there are 7 people. Every person shakes hands with every other person once. Counting the total no. of handshakes we get 6+5+4+3+2+1 = 21 handshakes. This shows that the no. of people who shake hands an odd no. of times are odd and this is against what we have to prove.

You're saying the 7th person shook hands with no one. Didn't they shake hands with everyone else? (in fact you should have $ 6\plus{}6\plus{}6\plus{}6\plus{}6\plus{}6\plus{}6$ instead of $ 6\plus{}5\plus{}4\plus{}3\plus{}2\plus{}1$)

If every one of 7 people shakes hands with every other person, every person shakes hands with 6 people.  Thus, the number of people who shake an even number of hands is 0, which is even.  Thus, this is clearly not a counter-example.

Your sum 6 + 5 + 4 + 3 + 2 + 1 correctly gives the total number of shakes, but the summands are [i]not[/i] the number of hands shaken by each person.  If you total up the number of hands that each person shook, you get 42 (an even number), not 21, since each of the 21 shakes will be counted by two people.


My teacher gave me the following question:

Consider an airplane with, say, 150 seats. The first person decides to randomly choose a seat, whereas the other passangers sit where their ticket tells them to sit. If a person comes to an occuped seat, the person randomly choose a seat. What is the probability that the last person gets his seat?

Hi,

Do the people come in order of their tickets? Like the person on the second seat comes in second, etc?

If so then...

[hide]We will try to prove that the last person can only be seated in the first or the last seat.

Let there be $ n$ seats. We will start by assuming that the last person can be seated somewhere in the middle $ n\minus{}2$ seats, which are the seats excluding the first and the last seats. But we can't quite seat him there because he must come in last, as I am assuming for this problem. So we will try to "reserve" that seat for him. But eventually, the person who has the number of the seat that we have reserved for the last person is going to come (which will be before the last person comes, of course). Also, let that person be called $ A.$ Since so far (until $ A$ came) we had the seat for $ A$ empty, as we were planning on letting the last person sit in it, now since $ A$ has come, $ A$ must sit in that seat. This applies for any $ A,$ therefore the last person cannot sit in any of the middle seats.

The last person can of course sit at the last seat. And the last person can also sit in the first seat, since there is nobody officially appointed for the first seat.

Therefore, the last person has two choices, sit at the first seat, or the last seat. So the probability that the last person ends up at the last seat is $ 1/2.$ [/hide]

I am not completely sure about my reasoning...  :maybe:

Yes they come in order of their tickets. I think youre right

the order they come in is irrelevant to the problem. since this is about matching passengers to their assigned seats you may as well re-label the seats 1, 2, ..., 150 in the same order as the passengers roll in.

anyway, your argument about the last person having to get his seat or the first person's seat is correct, but the answer is 1/2 only if these two possibilities have equal likelihood. do they?

Hi pluristiq,

I solved out a few cases for 2, 3, and 4 passengers and they had an equal number of seatings with the last passenger on the first seat and with the last passenger on the first seat. But I cannot prove that that will be the case always.

Another method that almost worked was:

For seating $ n$ people, there appears to be $ 2^{n \minus{} 1}$ total ways to seat them. So for the 149 passengers, there would have been $ 2^{148}$ ways to seat them. Then we the 150th passenger came aboard, for each of the $ 2^{148}$ seatings of the 149 passengers, the 150th passenger could sit at the end (his own seat). Since there are $ 2^{149}$ ways to seat the 150 passengers in all, the answer is $ \dfrac{2^{148}}{2^{149}} \equal{} 1/2.$

But in this proof, I couldn't find a way to prove that the total seatings for $ n$ people is indeed $ 2^{n \minus{} 1}.$

Searching for "choose seat random" finds
http://www.artofproblemsolving.com/Forum/viewtopic.php?search_id=290195053&t=27118
and
http://www.artofproblemsolving.com/Forum/viewtopic.php?search_id=290195053&t=128869


[quote="Abstract"]Let S=2^0 + 2^1 + 2^2 + .... + 2^n , n>0
what is the unit digit of S ?

|Abstract|[/quote]

[hide]  When $n$ divided by 4, leaves a remainder of:

0, the units digit of $S$ is 1

3, the units digit of $S$ is 5

2, the units digit of $S$ is 7

1, the units digit of $S$ is 3.[/hide]

[quote="Abstract"]View this site:
http://mathforum.org/library/resource_types/problems_puzzles/?keyid=14102200&start_at=51&num_to_see=50[/quote]

  why?

[quote="Abstract"]View this site:
http://mathforum.org/library/resource_types/problems_puzzles/?keyid=14102200&start_at=51&num_to_see=50[/quote]
i went to the site. Now what do i do on the site?

Indeed, there are a lot of links...
Maybe it's where he took the problem from... (one of the numerous links lol)


Convert the polar equation r = 2sin (3theta)  to a rectangular equation.

hello, we need the following formulas
$ x\equal{}r\cos(\theta)$
$ y\equal{}r\sin(\theta)$
$ r\equal{}\sqrt{x^2\plus{}y^2}$
$ \sin(\theta)\equal{}3\sin(\theta)\minus{}4\sin(\theta)^3$
from this follows directly
$ r\equal{}6 \sin(\theta)\minus{}8\sin(\theta)^3\equal{}6\frac{y}{r}\minus{}8\frac{y^3}{r^3}$
substituting $ r\equal{}\sqrt{x^2\plus{}y^2}$ gives us
$ (x^2\plus{}y^2)^2\equal{}6y(x^2\plus{}y^2)\minus{}8y^3$.
Sonnhard.


$n$ boys and $n$ girls compete in a table-tenis tournament. Each pair of contestants plays exactly once and no draws are possible. Prove that one can find a boy and a girl such that, at the end of the tournament, the number of contestants defeated by both is at least $\frac{n-1}{3}$.
It would be interesting to know which is the greatest $a$ for which $\frac{n-1}{3}$  can be replaced by $an-b$ for some $b$.

Suppose that some boy defeats at least $\frac{2n+1}{3}$ girls. Then, among these girls (call them set $X$) take one who has won at least half of the games she played in $X$ (it's obvious that there is at least one). Then she won at least $\frac{n-1}{3}$ games in $X$. Since the boy defeated all girls in $X$, he and she form a good pair and we're done.

Otherwise, suppose that every boy defeats at most $\frac{2n}{3}$ girls, and analogously that every girl defeats at most $\frac{2n}{3}$ boys. Then any person is defeated by at least $n-\frac{2n}{3}=\frac{n}{3}$ members of the opposite sex. Number the boys from $1$ to $n$ and the girls from $n+1$ to $2n$. For person $i$, let $B_i$ be the number of boys that he or she lost to, and $G_i$ the number of girls. Note that $\sum_{i=1}^n B_i=\sum_{i=n+1}^{2n} G_i=\frac{n(n-1)}{2}$. Now, since $G_i \geq \frac{n}{3}$ for $i$ a boy and viceversa, we have
\[ \sum_{i=1}^{2n} B_iG_i \geq 2 \times \frac{n}{3} \frac{n(n-1)}{2}=\frac{n^2(n-1)}{3}. \]
But the sum $B_iG_i$ is exactly the number of pairs of a boy and a girl who both defeat someone, taken over all participants. Since there are $n^2$ possible pairs, there's one who gets at least $\frac{n^2(n-1)}{3n^2}=\frac{n-1}{3}$ of these double defeats, which is what we wanted.

Thank you, very nice solution. I also solved it this way. Any ideas for the second one?


In how many points do the graphs of y= (e^x) +1 and y = 2sin (2pix) + 5 intersect?

I can't figure out how it would be evaluated without actually looking at the graphs, unless there is some explicit algorithm.

Correct me if I'm wrong, but $ y \equal{} 2\sin{2\pi i x} \plus{} 5$ only yields imaginary outputs.

Don't you mean $ y\equal{}2 \sin 2 \pi x \plus{} 5$?

The problem is not the complicated, notice that is only asks for [i]how many[/i] points not the point or points themselves.
[hide="HINT"]
Use the properties of both the sine and exponential functions.
[/hide]

I keep wanting to say an infinite number of times, since as you travel towards the negative side, both graphs are passing though each other as one becomes asymptotic $ y\equal{}1$ and the other oscillates between $ y\equal{}1$ and $ y\equal{}9$

SimonM, I agree.  I think it should be infinite but there is no sure way to know unless one looks at the graph.

Doesn't the trig graph oscillate between 3 and 7?


Is there any place I could find the Romanian sel tests from 1970-2002?

10x! cheers!!

pretty soon, my website !

have patience, I'm not getting paid in anyway for doing all this :)

i'm actually testing the new site and hopefully in a couple of days I will move to the new location.

I will start posting there all the problems.

I also would like you to tell me whatever formats do you wish the problems to be presented with (I was thinking of a html-.jpg / pdf combination, but I am openned to any other sugestions).

yeah... I am kool!!  :D (by the way would there be with solutions?) --> anyway if not with solution some of them will be discussed on th forum!!
g'luck with your site.. I was thinking more of a html/ps/pdf but it is better html/jpeg/pdf .. because ps are gone with the winds :D!

cheers!!

i use tex and I don't have time to rewrite all of them into html (instead of a^b puttin ab etc. ) i was thinking rather to use jpg files for html preview :)

jpg/pdf wud be fine.as it is my computer hates all other formats :D  :D  :D


a,b,c>0,$ a^2\plus{}b^2\plus{}c^2\equal{}3$
prove $ \sum a \ge\ \sum a^2b^2$

[quote="sorry iloveyourfriend"]a,b,c>0,$ a^2 \plus{} b^2 \plus{} c^2 \equal{} 3$
prove $ \sum a \ge\ \sum a^2b^2$[/quote]
See here:
http://www.artofproblemsolving.com/Forum/viewtopic.php?t=35839
http://www.artofproblemsolving.com/Forum/viewtopic.php?t=78010


$a,b,c$ positive number such that $abc=1$ then prove that
\[\frac{1}{(a+b)^{2}}+\frac{1}{(b+c)^{2}}+\frac{1}{(b+c)^{2}}\geq  \frac{3}{4}\]

[quote="silver1989"]I think the following inequality is true but i don't prove it
 $\sum\frac{c}{(a+b)^{2}}\geq \frac{3}{4}$[/quote]
Still wrong: $a=b=4$ and $c=\frac{1}{16}.$


[quote="linzk3"]Write as a single log and simplify.

xlog(3) + ylog(27) + zlog(81) = log ( )

can you factor out a 3...how?[/quote]

[hide]x log 3 + 3y log 3 + 4z log 3

=[b] (x + 3y + 4z) log 3[/b][/hide]


function
integration
real analysis
real analysis solved

Let f:[0,00) be a continuous function s.t. f(x)+ \int{0->x}f(t)dt has a finite limit as x->00. Show that f(x)->0 when x->00.

You'll probably it's easy..

Yes, it is quite easy:
   Consider F to be the integral. Then F'(x)+F(x) has the real limit l. Then
  (F(x)*e^x)'/(e^x)' tends to l, so F(x)*e^x/e^x tends also to l. That is F tends to l and so F' (which is f) tends to 0.


MNPQ is a parallelogram. X is a point in the diagonal NQ such that MX=x. MX cuts line NP in Y and XY=y; MX cuts line QP in Z. Find z=YZ in terms of x and y.  :D

[hide]The answer is $z = \frac{y^{2}+xy}{2x+y}$
the triangles $MQZ$ and $PYZ$ are similar so: $\frac{YP}{MQ}= \frac{ZY}{MZ}$  $(1)$
the triangles $MXN$ and $QXZ$ are similar so: $\frac{QZ}{MN}= \frac{XZ}{MX}$  $(2)$ $\Rightarrow$ $\frac{QZ}{ZP}= \frac{XZ}{MX-XZ}$.
because the triangles $MQZ$ and $PYZ$ are similar we have $\frac{QZ}{ZP}= \frac{YP}{MQ}$ so by $(1)$ and $(2)$ we have: $\frac{ZY}{MZ}= \frac{XZ}{MX-XZ}$ $\Rightarrow$ $\frac{z}{x+y-z}= \frac{y-z}{x-y+z}$ $\Rightarrow$ $\frac{z}{x+y}= \frac{y-z}{x}$ $\Rightarrow$ $z = \frac{y^{2}+xy}{2x+y}$. :D[/hide]


The aim of this thread is to describe the newly added package [color=blue]cse5[/color] and it usage. I plan to do it as a series of posts in this topic. If you want to ask questions about this package, please, use separate posts to keep this thread clean. The latest "official" version of the package can be downloaded from [url]http://www.artofproblemsolving.com/Forum/latexrender/asy/cse5.asy[/url].

[b]Acknowledgements[/b] This package would, probably, never be created without the discussion started by Hamster1800. As usual, special thanks go to Valentin for making it an easy add-on and for keeping this site running fairly smoothly :P.

[b]Why would one be interested in cse5?[/b]. Suppose your task is just to draw and label a couple of points and the line between them. After the usual assignment operator
[b]pair A=(0,0),B=(1,1);[/b]
you would normally write
[b]dot(A);dot(B);draw(A--B);label("A",A,W);label("B",B,E);[/b]
With cse5, you can write
[b]D(A);D(B);D(A--B);MP("A",A,W);MP("B",B,E);[/b]
or, more in the style of the package,
[b]D(MP("A",D(A),W)--MP("B",D(B),E));[/b]
which is already 30% shorter, so the 2000 charachter limit is effectively expanded to at least 3000 (for more advanced options, the gain is even larger) and you can do quite a lot with 1000 extra charachters (the full package code itself contains about 900 charachters, for instance). There is a small difference in the output as well:
[asy]import cse5; size(200); pair A=(0,0),B=(1,1); dot(A); dot(B); draw(A--B); label("A",A,W); label("B",B,E); pair A=(2,0),B=(3,1); D(MP("A",D(A),W)--MP("B",D(B),E));[/asy]
The standard code produces the output on the left and the cse5 code the one on the right.
The difference in length is even more striking for commands like OP:
[b]D(OP(A,B));[/b]
is equivalent to
[b]dot((intersectionpoints(A,B))[1]);[/b]
and
[b]a=IP(A,B);MP("X",D(a));[/b]
is equivalent to
[b]a=intersectionpoint(A,B);dot(a);label("$ X$",a,S);[/b]
with almost 50% gain. Besides IP() doesn't make the code crash even if the paths do not intersect, though, if you use its result for commands from outside the package in this case, the output will look strange (the package commands handle this situation in a much nicer way: you just don't see the objects defined using this fake point at all but see everything else).

[b]What can be done using only commands from the package?[/b] One can fully illustrate any Compass and StraightEdge construction. (That's where the letters cse in the name come from; 5 is the average amount of symbols per command). The limit of 2000 symbols should be enough to design almost everything you can do on a standard sheet of paper without making a total mess. Lets. say, we need to construct the middle bisector of an interval with endpoint A=(0,0) and B=(3,0)  in the standard way. The whole construction is here:
[b]pair A=(0,0),B=(3,0),X1,X2;
D(MP("A",D(A))--MP("B",D(B)));
X1=MP("X_1",IP(D(CR(A,2)),D(CR(B,2))));
X2=MP("X_2",OP(CR(A,2),CR(B,2)));
D(L(D(X1),D(X2)));[/b]
[asy]import cse5; size(200); pair A=(0,0),B=(3,0),X1,X2; D(MP("A",D(A))--MP("B",D(B))); X1=MP("X_1",IP(D(CR(A,2)),D(CR(B,2)))); X2=MP("X_2",OP(CR(A,2),CR(B,2))); D(L(D(X1),D(X2)));[/asy]
all done in 150 symbols (the assignment operators can be removed entirely, by the way). The number of storing, drawing, intersecting, and labeling operations is 23. The overhead (names,labels, and parameters) is 38. So, indeed, you have 5 symbols per operation as promised.But the most exciting point is that if you change the definition of B to B=(5,0); the code won't crash but just will show you what can be done:
[asy]import cse5; size(200); pair A=(0,0),B=(5,0),X1,X2; D(MP("A",D(A))--MP("B",D(B))); X1=MP("X_1",IP(D(CR(A,2)),D(CR(B,2)))); X2=MP("X_2",OP(CR(A,2),CR(B,2))); D(L(D(X1),D(X2)));[/asy]
This may not sound utterly exciting until you realize that the (almost) equivalent standard code, which is
[b]pair A=(0,0),B=(3,0),X1,X2;
dot(A);dot(B);label("A",A,S);label("B",B,S);draw(A--B);
path C1=circle(A,2),C2=circle(B,2),L;
draw(C1);draw(C2);
X1=intersectionpoint(C1,C2);dot(X1);label("X_1",X1,S);
X2=(intersectionpoints(C1,C2))[1];dot(X2);label("X_2",X2,S);
draw((2*X1-X2)--(2*X2-X1));[/b]
is about 290 symbols long and produces nothing but the "paths do not intersect" error message when B=(5,0).

Let's stop the shameless advertising here and go to the first meaningful subject.

[b]Drawing and Marking in cse5.[/b] The easiest way to understand what's going on is to work through an example. The typical code in the style of cse5 would be
[b]pair A=(0,0),B=(1,2),C=(2,1),D=(3,0),E=(4,2);
pen P=black+linewidth(6),Q=green;
D(D(A)..MP("B",B)..D(MP("C",C))..MP("D",D(D,P) ,(0,3))..MP("E_{12}",D(E,P,-1),16,NW),Q);   [/b]
which produces
[asy]import cse5; pair A=(0,0),B=(1,2),C=(2,1),D=(3,0),E=(4,2); pen P=black+linewidth(6),Q=green; D(D(A)..MP("B",B)..D(MP("C",C))..MP("D",D(D,P),(0,3))..MP("E",D(E,P,-1),16,NW),Q);[/asy]
First of all, why such names: D() and MP(). D stands for [b]D[/b]raw and MP for [b]M[/b]ark[b]P[/b]oint, which seems to be natural enough considering what these commands do: D draws a dot or a curve (given by a pair or a path respectively) and MP puts a mark on some point given by a pair.

So, what do we see in the code? The outer D(...,Q); construct tells us that something will be drawn with pen Q, so it remains to figure out what that something is. Since it includes a lot of .., it is easy to realize that it is a path that should be given by a sequence of pairs or paths between the ..operator. It is not hard to realize that in this case, they are pairs.

The easiest one is the first pair D(A). It is just the same as A but already drawn on the picture in the default style of D, which is minimal width blue for curves and red for dots.

MP("B",B) is just B that is marked by the charachter B in the default position and style, which are South and fontsize(11) $\LaTeX$. Since D is not executed on B, the dot does not appear on the picture, only its label.

The next one is more interesting. It is still the pair C in disguise that is both marked (by the character C) and drawn in the default styles. It (almost) doesn't matter in which order to apply D and MP to a pair, co MP("C",D(C)) would produce the same effect.

I'll skip the next point except noting that it's label positioned north 3 times the usual distance from the point itself and that Asymptote is clever enough to understand which D is a pair and which is a drawing construct and come directly to MP("E",D(E,P,-1),16,NW), which shows each command with its most full list of parameters.

We see that the label E is put at the point E with font of size 16 in the NorthWest position, which is what appears on the picture. Why didn't D put a dot then? Because there is a negative integer parameter in the end. It seems silly to put D just to disable it later, but it comes handy in the constructs like
[b]for(int k=0;k<10;++k) D((k,0),(k-3)*(k-7));[/b]
with the output
[asy]import cse5; for(int k=0; k<10; ++k) D((k,0),(k-3)*(k-7));[/asy]

Two final remarks. First, you may use the result of D or MP in any construction in which you can use their arguments.except you cannot write something like
[b]D(A)=expression;[/b]
but why would you need to when
[b]A=D(expression) ;[/b]
has exactly the effect you might expect from the first construct? Second, you are not obliged to write as tersely as above, the code
[b]pair A=(0,0),B=(1,2),C=(2,1),D=(3,0),E=(4,2);
pen P=black+linewidth(6),Q=green;
D(A..B..C..D..E,Q);
D(A);
MP("B",B);
D(MP("C",C));
MP("D",D(D,P),(0,3));
MP("E_{12}",D(E,P,-1),16,NW);  [/b]
is just 9 symbols longer and produces a nicer picture:
[asy]import cse5; size(200); pair A=(0,0),B=(1,2),C=(2,1),D=(3,0),E=(4,2); pen P=black+linewidth(6),Q=green; D(A..B..C..D..E,Q); D(A); MP("B",B); D(MP("C",C)); MP("D",D(D,P),(0,3)); MP("E_ { 12} ",D(E,P,-1),16,NW);[/asy]
Do you see what the difference between the pictures is, by the way? Usung draw, dot and label would require at least 20 more symbols (even if you forfeit the font change and the LaTeXication of labels) and the whole drawing part is about 85 symbols long, so we save 28% on drawing which is not that bad. The only thing that remains to do is to show the code for D and MP. Here goes:
[code]
path D(path p, pen q=blue, int m=1)
{
if(m>0) draw(p,q);
return p;
}
pair D(pair p, pen q=red, int m=1)
{
if ((p!=nullpair)&&(m>0)) dot(p,q);
return p;
}
pair MP(string s, pair A, int f=11,pair B=plain.S)
{
if (A!=nullpair) label("$"+s+"$",A,B,fontsize(f));
return A;
}
[/code]
What on Earth is nullpair? That will become clear in the next post.

[b]Intersecting of paths in cse5[/b]. The name of the main command that does it is [b]IP[/b], which is, of course, just the abbreviation of IntersectionPoint. You can use
[b]IP(A,B,m)[/b]
instead of
[b](intersectionpoints(A,B))[m][/b]
anywhere in the asy code, which by itself is enough to cover the cost of
[b]import cse5;[/b]
line: $9+12<28$ but the main advantage is that the code with [b]IP()[/b] doesn't crash even if the paths do not intersect because [b]IP()[/b] always returns a pair. Only if the paths do not intersect, it is a very particular pair whose name is [b]nullpair[/b] and whose value is currently [b](1.2345,6.7890)[/b] (can't explain why :D). All the internal routines of cse5 know how to handle this special pair and act appropriately. By the way, if you ever desperately need to use this particular pair for other purposes, you can reset the cse5 default value by
[b]nullpair=(9876,5432)[/b]
or whatever else you wish in the beginning of the code (doing it in the middle is not advisable: the program won't crash but the nullpair created by some command before the change will not be recognised by the commands after the change and one of the the nicest properties of cse5, which is drawing exactly as much as possible, will be destroyed like in the code
[b]import cse5;
size(200);
pair A=(0,0),B=(5,0),X1,X2;
D(MP("A",D(A))--MP("B",D(B)));
X1=MP("X_1",IP(D(CR(A,2)),D(CR(B,2))));
X2=MP("X_2",OP(CR(A,2),CR(B,2)));
[color=red]nullpair=(2.345,30.23);[/color]
D(L(D(X1),D(X2)));[/b]
(our old code from the advertising part to which one command is added) which outputs
[asy]import cse5; size(200); pair A=(0,0),B=(5,0),X1,X2; D(MP("A",D(A))--MP("B",D(B))); X1=MP("X_1",IP(D(CR(A,2)),D(CR(B,2)))); X2=MP("X_2",OP(CR(A,2),CR(B,2))); nullpair=(2.345,30.23); D(L(D(X1),D(X2)));[/asy]
See that red dot above that appeared? That's your old nullpair. It now came into existence. The code with new nullpair assignment done in the beginning (the best place for it is right after the import cse5; command) won't produce any such effect. The nullpair can never be brought into existence by the commands from cse5 but, if you run a mixed code with routines from other packages, you will get somewhat inexpected picture. Suppose, for instance, that we want to draw the quadrilateral $AX_{1}BX_{2}$ in addition to our picture.
All we need to add to our old code is the line
[b]D(A--X1--B--X2--A);[/b]
which in the "normal" case with B=(3,0) will produce
[asy]import cse5; size(200); pair A=(0,0),B=(3,0),X1,X2; D(MP("A",D(A))--MP("B",D(B))); X1=MP("X_1",IP(D(CR(A,2)),D(CR(B,2)))); X2=MP("X_2",OP(CR(A,2),CR(B,2))); D(L(D(X1),D(X2))); D(A--X1--B--X2--A);[/asy]
but in the "irregular" case B=(5,0) gives
[asy]import cse5; size(200); pair A=(0,0),B=(5,0),X1,X2; D(MP("A",D(A))--MP("B",D(B))); X1=MP("X_1",IP(D(CR(A,2)),D(CR(B,2)))); X2=MP("X_2",OP(CR(A,2),CR(B,2))); D(L(D(X1),D(X2))); D(A--X1--B--X2--A);[/asy]
which is not such a clean picture as before but it is still clear from it what exactly happened. Is it possible to make the standard operators like -- recognize the nullpair too? The answer is yes, to a certain extent. If all you need is that the path skip the fake points and just join all existing ones, that is easy to do and we'll see how to make such a quick fix later. If you want, it is possible to introduce a [b]BL()[/b] (BrokenLine) command such that BL(A,B,C,D) would be equivalent to A--B--C--D in the normal case and to nullpath if one of the pairs A,B,C,D is equivalent to nullpair, but to make the paths A--B--C--D with at least one fake point completely disappear and -- as usable as before is hardly feasible.

Now, as we all remember, two paths may intersect at more than one point and we may want some particular point on the picture. Suppose that we have two paths: the green curve P and the blue line Q on this picture
[asy]import cse5; size(200); pair A=(0,0),B=(1,2),C=(2,1),D=(3,0),E=(4,2),G=(-1,1),F=(5,1); path P=D(MP("P",A,SE)..B..C..D..E,green), Q=D(MP("Q",G,W)--F);[/asy]
They clearly intersect at 3 different points. Suppose we want to draw the middle point and to mark it with $X$. Writing
[b]D(MP("X",IP(P,Q)));[/b]
will produce
[asy]import cse5; size(200); pair A=(0,0),B=(1,2),C=(2,1),D=(3,0),E=(4,2),G=(-1,1),F=(5,1); path P=D(MP("P",A,SE)..B..C..D..E,green), Q=D(MP("Q",G,W)--F); D(MP("X",IP(P,Q)));[/asy]
which is not what we want. The way out is to write [b]IP(P,Q,1)[/b] instead:
[asy]import cse5; size(200); pair A=(0,0),B=(1,2),C=(2,1),D=(3,0),E=(4,2),G=(-1,1),F=(5,1); path P=D(MP("P",A,SE)..B..C..D..E,green), Q=D(MP("Q",G,W)--F); D(MP("X",IP(P,Q,1)));[/asy]
The last optional integer argument shows which particular point should be chosen. They are enumerated starting with the index $0$, so plain [b]IP(P,Q)[/b] is equivalent to [b]IP(P,Q,0)[/b]. If you choose it out of admissible range, nullpair will be returned, so, if for some reason, you wish to enumerate all the points and call the $k$-th point $X_{k}$ and all you know for sure is that you have at most 10 points, you can write
[b]string s;
for(int k=-2;k<10;++k)
{
s="X_"+string(k);
D(MP(s,IP(P,Q,k)));
}[/b]
with the output
[asy]import cse5; size(200); pair A=(0,0),B=(1,2),C=(2,1),D=(3,0),E=(4,2),G=(-1,1),F=(5,1); path P=D(MP("P",A,SE)..B..C..D..E,green), Q=D(MP("Q",G,W)--F); string s; for(int k=-2; k<10; ++k) { s="X_"+string(k); D(MP(s,IP(P,Q,k))); }[/asy]

Of course, $-2$ is here just to demonstrate that [b]IP[/b] doesn't crash with negative integer argument either. $0$ would be what you really want in this case. This is, of course, a not very clean shortcut. The perfect way of doing this would be to write
[b]k<(intersectionpoints(P,Q)).length[/b]
but this expression is extremely expensive: 32 symbols instead of 4.

Since [b]IP(P,Q,1)[/b] arises fairly often, cse5 has a special routine for it: [b]OP(P,Q)[/b] where OP stands for [b]O[/b]ther[b]P[/b]oint.

The last thing to say before showing the code is that [b]IP[/b] is, unfortunately, not completely foolproof: it handles the case when the paths do not intersect neatly but the case when the paths intersect at infinitely many points like, say, in [b]IP(P,P)[/b], makes the program crash without even showing what is wrong. The reason is not a faulty code for [b]IP[/b] but rather that for [b]intersectionpoints[/b] in Asymptote. The older command [b]intersectionpoint[/b] can handle this case but crashes for non-intersecting paths where intersectionpoints just returns an array of 0 length that IP can catch and resolve into nullpair.

Now the code:
[code]
pair IP(path A, path B, int m=0)
{
pair[] intpoints=intersectionpoints(A,B);
int len=intpoints.length-1;
if ((m>len)||(m<0)) return nullpair;
return intpoints[m];
}
pair OP(path A, path B)
{
return IP(A,B,1);
}
[/code]

The next topic is other commands in cse5.

[b]Other commands of cse5[/b].

[b]L()[/b] This one, as one can guess, stands for [b]L[/b]ine. It allows you to create a path that is just a segment of a line going through the points $A$ and $B$. The Line command has 4 parameters: 2 required (pairs A and B) and 2 optional (real a and real b). The role of A and B is clear and a and b tell you how much to extend the line beyond the points $A$ and $B$. For instance,
[b]L(A,B,1,0);[/b]
produces
[asy]import cse5; size(200); pair A=MP("A",D((0,0))), B=MP("B",D((3,1))); D(L(A,B,1,0));[/asy]
which is a line extended beyond $A$ by the length of the interval $AB$ and not extended beyond $B$ at all. Using [b]L()[/b] with one real parameter instead of two gives the same result as if two equal parameters were used, so [b]L(A,B,1.5)[/b] is exactly equivalent to [b]L(A,B,1.5)[/b], both producing
[asy]import cse5; size(200); pair A=MP("A",D((0,0))), B=MP("B",D((3,1))); D(L(A,B,1.5));[/asy]
You can even use negative parameters for a and b to produce a line that doesn't quite reach the points it defines. For instance,
[b]L(A,B,-0.1,-0.5);[/b]
produces
[asy]import cse5; size(200); pair A=MP("A",D((0,0))), B=MP("B",D((3,1))); D(L(A,B,-0.1,-0.5));[/asy]
You should be careful with negatives, though:
[b]L(A,B,-1);[/b]
produces
[asy]import cse5; size(200); pair A=MP("A",D((0,0))), B=MP("B",D((3,1))); D(L(A,B,-1));[/asy]
which looks exactly the same as the output of [b]L(A,B,0)[/b]. What's the difference? The path is now run in reverse. The default values are $b=a=0.6$

[b]CR(A,r)[/b] or [b]C[/b]ircleby[b]R[/b]adius. It produces a circle with center $A$ given by a pair and radius $r$ given by a real. If $r\le 0$, it produces nullpath. That's all there is to say about it right now.

[b]CP(A,B)[/b] or [b]C[/b]ircleby[b]P[/b]oint. It produces a circle with center $A$ given by a pair going through another point $B$ also given by a pair:
[asy]import cse5; size(200); pair A=MP("A",D((0,0))), B=MP("B",D((3,1))); D(CP(A,B));[/asy]

[b]d(A,B)[/b] returns the [b]d[/b]istance between the points given by the pairs A and B, so, you no longer need to write those [b]sqrt((A.x-B.x)^2+(A.y-B.y)^2)[/b] in your code.

This list of commands can always be expanded if we find out that there are some other useful things we'd better predefine but now we've covered all the existing commands in the original version of cse5 and it is time to talk a bit about programming.

[b]Reading and writing terse code[/b] This is something you are under no obligation to do but it is what cse5 was originally designed for. Suppose you want to construct a bisector of an angle $A$ in the triangle $ABC$. You can write something like that:
[b]pair A=(0,0),B=(0,3),C=(3,2);
D(A);D(B);D(C);
MP("A",A);MP("B",B);MP("C",C);
D(A--B--C--A,black);
path K=CR(A,1);
D(K);
pair b=IP(K,A--B);
D(b);
MP("B_1",b);
pair c=IP(K,A--C);
D(c);
MP("C_1",c);
path Kb=CR(b,0.7);
D(Kb);
path Kc=CR(c,0.7);
D(Kc);
pair x=IP(Kb,Kc);
D(x);
MP("X",x);
pair y=OP(Kb,Kc);
D(y);
MP("Y",y);
path L=L(x,y);
D(L,green);[/b]
which is a nice code that produces
[asy]import cse5; size(200); pair A=(0,0),B=(0,3),C=(3,2); D(A);D(B);D(C); MP("A",A);MP("B",B);MP("C",C); D(A--B--C--A,black); path K=CR(A,1); D(K); pair b=IP(K,A--B); D(b); MP("B_1",b); pair c=IP(K,A--C); D(c); MP("C_1",c); path Kb=CR(b,0.7); D(Kb); path Kc=CR(c,0.7); D(Kc); pair x=IP(Kb,Kc); D(x); MP("X",x); pair y=OP(Kb,Kc); D(y); MP("Y",y); path L=L(x,y); D(L,green);[/asy]
It is 344 symbols long (counting spaces and carriage returns). Let's see if we can write a shorter program. The first obvious thing to do is to declare all paths, pairs, etc. in one long declaration. This will spare us a few symbols. So, we'll write
[b]pair A=(0,0),B=(0,3),C=(3,2),b,c,x,y;
path K,Kb,Kc,L;
D(A);D(B);D(C);
MP("A",A);MP("B",B);MP("C",C);
D(A--B--C--A,black);
K=CR(A,1);
D(K);
b=IP(K,A--B);
D(b);
MP("B_1",b);
c=IP(K,A--C);
D(c);
MP("C_1",c);
Kb=CR(b,0.7);
D(Kb);
Kc=CR(c,0.7);
D(Kc);
x=IP(Kb,Kc);
D(x);
MP("X",x);
y=OP(Kb,Kc);
D(y);
MP("Y",y);
L=L(x,y);
D(L,green);[/b]
reducing the count to 334 symbols. Not a big gain, but a gain nevertheless. Now, let us look at the last two lines
[b]L=L(x,y);
D(L,green);[/b]
We see that the symbol L appears just to be immediately used as an argument of the line routine and never appear again. What cse5 allows to do in this case is to get rid of L completely and write directly
[b]D(L(x,y),green);[b]
Look now at
[b]y=OP(Kb,Kc);
D(y);
MP("Y",y);
[/b]
It can be rewritten as
[b]y=MP("Y",D(OP(Kb,Kc)));
Doing a few tricks like that, we get the code
[b]pair A=(0,0),B=(0,3),C=(3,2),b,c,x,y;
path K,Kb,Kc;
MP("A",D(A));MP("B",D(B));MP("C",D(C));
D(A--B--C--A,black);
K=D(CR(A,1));
b=MP("B_1",D(IP(K,A--B)));
c=MP("C_1",D(IP(K,A--C)));
Kb=D(CR(b,0.7));
Kc=D(CR(c,0.7));
x=MP("X",D(IP(Kb,Kc)));
y=MP("Y",D(OP(Kb,Kc)));
D(L(x,y),green);[/b]
which is 275 symbols long. That's quite a gain but we can go even further. Again, x and y appear just to be called as arguments and disappear entirely, so, down with them! The same happens with a and b. The next iteration is
[b]pair A=(0,0),B=(0,3),C=(3,2);
path K,Kb,Kc;
D(MP("A",D(A))--MP("B",D(B))--MP("C",D(C))--A,black);
K=D(CR(A,1));
Kb=D(CR(MP("B_1",D(IP(K,A--B))),0.7));
Kc=D(CR(MP("C_1",D(IP(K,A--C))),0.7));
D(L(MP("X",D(IP(Kb,Kc))),MP("Y",D(OP(Kb,Kc)))),green);[/b]
which is 243 symbols long and still produces the same picture. How about getting rid of K, say? We can do it but it won't be an improvement because it is used as an argument [b]twice[/b], so replacing K by its definition won't help much. So, we have 243 symbol long program now instead of 344. Suppose that we have to draw all 3 bisectors in the triangle with full notation like we did for one of them. Ignoring the cost of drawing the triangle itself, we see that the cost of actual drawing a bisector is 140. So, will we need $243+2\cdot 140=523$ symbols? We can afford it, it is still well below the limit but we can get away with fewer if we enclose the drawing piece into a subroutine, say B(), with B for [b]B[/b]isector. How to set a subroutine? First of all, extract the code that you planned to repeat without much thinking of what is written there:
[b]pair A=(0,0),B=(0,3),C=(3,2);
path K,Kb,Kc;
D(MP("A",D(A))--MP("B",D(B))--MP("C",D(C))--A,black);
[color=green]
K=D(CR(A,1));
Kb=D(CR(MP("B_1",D(IP(K,A--B))),0.7));
Kc=D(CR(MP("C_1",D(IP(K,A--C))),0.7));
D(L(MP("X",D(IP(Kb,Kc))),MP("Y",D(OP(Kb,Kc)))),green);
[/color][/b]
Secondly, look at what's specific for this part and was going to change when rewriting. Those are, of course the pairs A,B,C and all the names given by strings in various MP's. Write them as arguments (a good idea is to make the string names look pretty much like the strings themselves), replace the strings by their names, and get
[b]void B(pair A,pair B,pair C,string B1, string C1, string X, string Y)
{
K=D(CR(A,1));
Kb=D(CR(MP(B1,D(IP(K,A--B))),0.7));
Kc=D(CR(MP(C1,D(IP(K,A--C))),0.7));
D(L(MP(X,D(IP(Kb,Kc))),MP(Y,D(OP(Kb,Kc)))),green);
}[/b]
Only wait a minute. Why should B return void? It does a very particular thing: draws a line. So, let's return this line instead (it is not needed for just drawing but, if we are to find the incenter, it may come handy. So, our final version will be
[b]path B(pair A,pair B,pair C,string B1, string C1, string X, string Y)
{
K=D(CR(A,1));
Kb=D(CR(MP(B1,D(IP(K,A--B))),0.7));
Kc=D(CR(MP(C1,D(IP(K,A--C))),0.7));
return D(L(MP(X,D(IP(Kb,Kc))),MP(Y,D(OP(Kb,Kc)))),green);
}[/b]
Now, we just call B three times with any notation we want to set up:
[b]pair A=(0,0),B=(0,3),C=(3,2);
path K,Kb,Kc;
D(MP("A",D(A))--MP("B",D(B))--MP("C",D(C))--A,black);
path B(pair A,pair B,pair C,string B1, string C1, string X, string Y)
{
K=D(CR(A,1));
Kb=D(CR(MP(B1,D(IP(K,A--B))),0.7));
Kc=D(CR(MP(C1,D(IP(K,A--C))),0.7));
return D(L(MP(X,D(IP(Kb,Kc))),MP(Y,D(OP(Kb,Kc)))),green);
}
B(A,B,C,"B_a","C_a","X_a","Y_a");
B(B,C,A,"C_b","A_b","X_b","Y_b");
B(C,A,B,"A_c","B_c","X_c","Y_c");[/b]
and, voila, all three bisectors are there:
[asy]import cse5; size(200); pair A=(0,0),B=(0,3),C=(3,2); path K,Kb,Kc; D(MP("A",D(A))--MP("B",D(B))--MP("C",D(C))--A,black); path B(pair A,pair B,pair C,string B1, string C1, string X, string Y) { K=D(CR(A,1)); Kb=D(CR(MP(B1,D(IP(K,A--B))),0.7)); Kc=D(CR(MP(C1,D(IP(K,A--C))),0.7)); return D(L(MP(X,D(IP(Kb,Kc))),MP(Y,D(OP(Kb,Kc)))),green); } B(A,B,C,"B_a","C_a","X_a","Y_a"); B(B,C,A,"C_b","A_b","X_b","Y_b"); B(C,A,B,"A_c","B_c","X_c","Y_c");[/asy]
The length of the code is just 415 symbols and the cost of a bisector is now 33 symbols per bisector compared to 140.

The last question is how to read such code when you see it. Start with the end. You see that some routine is called 3 times, so just figure out what it does one time. There are just four lines in the code of the routine, so, let's analyze the most complicated expression:
[b]D(L(MP(X,D(IP(Kb,Kc))),MP(Y,D(OP(Kb,Kc)))),green);[/b]
You see that D is the outer command, so, something is going to be drawn in green. The next command is L, so it is a line. The line requires 2 points and in this case the points look terribly similar, so we are down to
[b]MP(X,D(IP(Kb,Kc)))[/b]
to analize. MP just marks a point by $X$, D just draws it, so we are left with[b]IP(Kb,Kc)[/b], which is clear enough.

The next topic is some tricks and treats. I hope that Valentin will install a new version of cse5 by then (the backward compatibility is complete), so I'll be able to describe some features that are not present yet :).

[quote="fedja"]The next topic is some tricks and treats. I hope that Valentin will install a new version of cse5 by then (the backward compatibility is complete), so I'll be able to describe some features that are not present yet :).[/quote]The newest version is installed.

[b]A new version of cse5[/b]
Here I'll describe a few features that were added to cse5 recently.

[b]Choosing your drawing style.[/b] It is possible to customise the default pens cse5 uses for drawing paths and points. The names of the pens are [b]pathpen[/b] and [b]pointpen[/b] respectively. I personally like thin blue lines and small red dots but nobody said you should like them too. Suppose you like thick green lines and even thicker black dots. Just write
[b]pathpen=green+linewidth(2);
pointpen=black+linewidth(6);[/b]
in the beginning of your code and you are there:
[asy]import cse5; size(200); pathpen=green+linewidth(2); pointpen=black+linewidth(6); D(D((0,0))--D((2,1))--D((4,2)));[/asy]
There is one more pen in cse5 you may want to customise: [b]errorpen[/b]. What is it for? Just wait a minute, we'll come to that in its time :).

Looking at the picture above, you may become a bit upset: the line is OK, but the points aren't nice and round but rather partially devoured by the line going through them. The middle point seems to suffer most. What to do? It is clear that it would be nice to draw all the points (and labels) after all lines. In this short code it is, of course, possible but suppose you have a long code with many points to draw. Should you assign a separate name to each point and end your code with a long string of D() commands? This will be really a headache and it'll effectively eliminate all the advantages of drawing-en-passe. The new version of cse5 offers a better solution inspired by how it is done in $\LaTeX$. There is a Boolean variable in cse5 called [b]pathflag[/b] that you can set to either true or false. When it is true, it results in normal drawing, but when it is false, the paths are not drawn at all, only points and labels appear on the picture, so
[b]
pathflag=false;
pathpen=green+linewidth(2);
pointpen=black+linewidth(6);
D(MP("A",D((0,0)))--MP("B",D((2,1)))--MP("C",D((4,2))));
[/b]
results in
[asy]import cse5; size(200); pathflag=false; pathpen=green+linewidth(2); pointpen=black+linewidth(6); D(MP("A",D((0,0)))--MP("B",D((2,1)))--MP("C",D((4,2))));[/asy]
It doesn't seem particularly useful by itself because you still want your paths back, but if you take your old picture with paths abusing points and draw your new picture with paths removed over it, the points will be restored to their full plumpy roundness. So, you'll have to execute your code twice: once with pathflag=true (which is the default, you do not need to set it up) and once with pathflag=false. Does it mean that you have to [b]type[/b] your code twice? For God's sake, no! Just enclose your entire code into a subroutine, say B() for [b]B[/b]eautification and write something like
[b]
import cse5;
size(YOUR SIZE);
void B()
{
YOUR FULL CODE
}
B();pathflag=false;B();
[/b]
In our particular case, we get
[asy]import cse5; size(200); void B() { pathpen=green+linewidth(2); pointpen=black+linewidth(6); D(MP("A",D((0,0)))--MP("B",D((2,1)))--MP("C",D((4,2)))); } B();pathflag=false;B();[/asy]
This beautification comes at a cost, of course, which is 33 extra symbols and doubling the running time but 33 is not such a huge number and posting a correct tried at home program that does something twice is better in terms of saving server time than posting an erratic program once, correcting it and posting it again, which is a sin most of us are guilty of. So, I wouldn't hesitate to use this trick with tried at home programs. Also, the thin paths of the default style do not abuse the points too much unless you have too many of them passing through one point, which makes this trick not always really necessary.

Now there are two more Boolean variables controlling the execution of [b]D()[/b] in cse5 that you must be aware of: [b]breakflag[/b] and [b]fullbreak[/b]. What are they doing? As I said above, cse5 tries to do as much as it can even if there are some paths that do not intersect the way they should. If you are doing just a pure compass-straightedge construction, the output will be completely satisfactory. But if you are mixing it with other Asymptote commands or if you use cse5 just for the sake of drawing-en-passe and foolproof IP but your main construction is not about circles and lines at all, that nullpoint may create quite a mess. So, there is another way that allows you to see where you get an error. Let's try an example. Write something like
[b]
path[] P=(0,0)--(1,1)^^(2,-1)--(3,1);
path[] Q=(0,0)--(3,0)^^(3,0.5)--(0,0.5)^^(0,1)--(3,1);
D(MP("X",D(IP(DPA(Q,green),DPA(P),3)))--D((0,0)),black);[/b]
with output
[asy]import cse5; size(200); path[] P=(0,0)--(1,1)^^(2,-1)--(3,1); path[] Q=(0,0)--(3,0)^^(3,0.5)--(0,0.5)^^(0,1)--(3,1); D(MP("X",D(IP(DPA(Q,green),DPA(P),3)))--D((0,0)),black);[/asy]
What is [b]DPA[/b] by the way? It is cse5 command for drawing path arrays, not individual paths. Note that ^^ creates not a path like .. or -- but a path array, so D() won't work in this case. Otherwise, DPA has the same (dis)advantages as D().

Now, we see that the green lines intersect the blue ones at 6 different points. So, asking for the intersection point with index 6 instead of 3,say, will result in a drawing error. Normally, this error will be resolved into
[asy]import cse5; size(200); path[] P=(0,0)--(1,1)^^(2,-1)--(3,1); path[] Q=(0,0)--(3,0)^^(3,0.5)--(0,0.5)^^(0,1)--(3,1); D(MP("X",D(IP(DPA(Q,green),DPA(P),6)))--D((0,0)),black);[/asy]
but if you add the
[b]
fullbreak=true;
[/b]
line in the beginning of your code, you'll see
[asy]import cse5; size(200); fullbreak=true; path[] P=(0,0)--(1,1)^^(2,-1)--(3,1); path[] Q=(0,0)--(3,0)^^(3,0.5)--(0,0.5)^^(0,1)--(3,1); D(MP("X",D(IP(DPA(Q,green),DPA(P),6)))--D((0,0)),black);[/asy]
This picture should be good enough to see from it where the program went astray. The only disadvantage is that fullbreak=true; suppresses all further drawing and labeling after the very first path intersection error, so, if you have several problems like that in your code, you'll see only the first one. The message appears near the point given by the pair [b]messageplace[/b] (the default is (0,5)), which you are welcome to reset to whatever you wish. A good idea would be to set it a bit above or a bit below your drawings in the middle in the horizontal direction. So
[b]
messageplace=(1.5,2);
[/b]
will be perfect for this particular picture:
[asy]import cse5; size(200); fullbreak=true; messageplace=(1.5,2); path[] P=(0,0)--(1,1)^^(2,-1)--(3,1); path[] Q=(0,0)--(3,0)^^(3,0.5)--(0,0.5)^^(0,1)--(3,1); D(MP("X",D(IP(DPA(Q,green),DPA(P),6)))--D((0,0)),black);[/asy]
The poorly intersecting paths are drawn with a special pen [b]errorpen[/b], which is yellow+linewidth(2) by default and which you can change to whatever your wish by [b]errorpen=YOUR PEN[/b] command. The only advice is to choose some light color for errorpen on which the black intersection points and their numbers will be clearly visible. The [b]breakflag[/b] variable is the auxiliary variable controlled by the [b]IP[/b] command. If the paths do not intersect as they should, its value is set to true, which allows the drawing commands "see" that the drawing may be erratic after that. If fullbreak=true by that moment, they just don't draw anything at all but if fullbreak is still false, they continue to draw.

The next topic is about a few things you should know about IP in cse5.

[b]A few things to know about IP().[/b] In the latest version of cse5, the [b]IP()[/b] command is based directly on the [b]intersect[/b] command of Asymptote rather than on its derivatives [b]intersectionpoint[/b] or [b]intersectionpoints[/b] as in the original version. The reason is that [b]intersectionpoint[/b] is not flexible enough and crashes the code when the paths fail to intersect and [b]intersectionpoints[/b] can effectively suspend Asymptote when one tries to use it to find the common point of a line and a circle that is tangent to this line, not mentioning an attempt to intersect a path with itself. [b]IP()[/b] seems to handle all these cases reasonably well. An attempt to intersect a path with itself results in an array of 100 pairs lying on the path near its beginning, so, the code
[b]
pair A=(0,0),B=(3,1);
MP("X",D(IP(D(A--B),A--B,5)));
[/b]
say, doesn't result in an infinite loop the command [b](intersectionpoints(A--B,A--B))[5][/b] would produce but rather returns a point on the path near its beginning. How near depends on the integer parameter in the [b]IP()[/b] command: the point is the very beginning of the path if it is $0$ and is about $1/3$ of the path length from the beginning if it is $100$. In our case, the output is
[asy]import cse5; size(200); pair A=(0,0),B=(3,1); MP("X",D(IP(D(A--B),A--B,5)));[/asy]
The tangency points are taken care of quite nicely too. The code
[b]
fullbreak=true;
pair A=MP("A",(-2,1)),B=MP("B",(0,0)),C=MP("C",(2,3));
path P=A--B--C--cycle,Q=incircle(A,B,C);
IP(P,Q,3);
[/b]
produces
[asy]import cse5; size(200); fullbreak=true; pair A=MP("A",(-2,1)),B=MP("B",(0,0)),C=MP("C",(2,3)); path P=A--B--C--cycle,Q=incircle(A,B,C); IP(P,Q,3);[/asy]
which shows that [b]IP()[/b] found all three tangency points and enumerated them correctly. If you try [b](intersectionpoints(P,Q))[3][/b] instead, you'll just suspend the Asymptote. You may try it on your home computer where you can easily shut the non-responding programs down but [color=red]please, abstain from doing such experiments on the site[/color]. So, using [b]IP()[/b] instead of [b]intersectionpoint[/b] and [b]intersectionpoints[/b] seems to be quite advantageous in terms of safe and smooth execution of your code.

Of course, everything comes at a cost. There are two downsides of [b]IP()[/b]. First, if your two paths intersect at more than 100 points, [b]IP()[/b] will find only first 100 of them. Second, if you have 2 intersection points that lie at the distance of less than $1/300$ of the total path length from each other, [b]IP()[/b] will see only the first of them. I find these downsides quite minor compared to the erratic run of [b]intersectionpoints[/b] in the case of tangency, but, if you think otherwise, you are welcome to try your code with the standard asymptote commands instead of [b]IP[/b] and see if it runs any better.

The next thing you should know about [b]IP()[/b] is that it is the single most time consuming command. The same is true for the [b]intersectionpoints[/b], of course. The running time is directly proportional to the number of common points (even if just one point is requested, [b]IP()[/b] starts with finding them all) and to the complexity of the paths to intersect (so, intersecting 2 circles, say, takes more time than intersecting a circle and a line, which takes more time than intersecting 2 lines). So, if you need to work with more than just a few common points of 2 paths, it may be wise to use the cse5 command [b]IPs()[/b] to get the full array once and then to work with the elements of that array instead of calling [b]IP()[/b] again and again.

To illustrate what I'm talking about, let's suppose that you want to draw something like this;
[asy]import cse5; size(300); path[] P,Q; int k; for(k=0;k<360;k=k+10) P=P^^(0,0)--30.01*dir(k); for(k=10;k<=30;++k) Q=Q^^CR((0,0),k); pair[] S=IPs(DPA(P),DPA(Q)); for(k=0;k<S.length;++k) D(S[k]);[/asy]
The code
[b]
path[] P,Q;
int k;
for(k=0;k<360;k=k+10) P=P^^(0,0)--30.01*dir(k);
for(k=10;k<=30;++k) Q=Q^^CR((0,0),k);
for(k=0;k<36*21;++k) D(IP(P,Q,k));
[/b]
will do the job [b]eventually[/b] but this code took well over 3 minutes to execute on my home PC. The picture was actually drawn by the code
[b]
path[] P,Q;
int k;
for(k=0;k<360;k=k+10) P=P^^(0,0)--30.01*dir(k);
for(k=10;k<=30;++k) Q=Q^^CR((0,0),k);
pair[] S=IPs(DPA(P),DPA(Q));
for(k=0;k<S.length;++k) D(S[k]);
[/b]
in which all the intersection points were found just once by executing a single [b]IPs()[/b] command. This code ran in under 2 seconds. Note also the $30.01$ instead of more natural $30$. This is another little problem that [b]IP()[/b] shares with [b]intersectionpoint(s)[/b]. The reason is that the Asymptote circle is actually a cubic spline and it is a bit wider than the true circle, so the non-extended radii fail to reach it. I think this can be corrected (if anyone cares) by playing a bit with the parameters of the [b]intersect[/b] command but I decided that I bothered Valentin just enough for now, so, if there is enough interest in cse5, I'll update the site code in the end of each month during which there are some bug reports or suggestions for improvements.

As you noticed, [b]IP()[/b] or [b]IPs[/b] can find the intersection points not just of 2 paths, but also of 2 path arrays. They still allow only 100 points per each pair of paths in the arrays. The points are enumerated in the following way. When you have just two paths, they are assigned their numbers according to their order on the first path (so [b]IP(P,Q)[/b] may be actually the same as [b]IP(Q,P,3)[/b] or something like that. When you have path arrays, first the first path in the first array is intersected with each path in the second array, then the second path in the first array is intersected with each path in the second array, and so on.

Unlike [b]IP()[/b], the [b]IPs[/b] command is not fullproof. It returns the array of intersection points but makes no attempt to guess what range of indices you will be interested in. So, it is your responsibility to ensure that you have enough intersection points when going with [b]IPs()[/b].

The last thing to mention is one subtle difference between the open path [b]A--B--C--A[/b] and the cyclic path [b]A--B--C--cycle[/b]  from the viepoint of the [b]IP()[/b] command. In the first case, the starting and the ending [b]A[/b] are considered as two distinct points and in the second case, they are considered as the same point. So an attempt to intersect the horizontal line [b](-1,0)--(1,0)[/b] with the path [b](0,0)--(1,1)--(-1,1)--(0,0)[/b] will result in 2 intersection points both located at [b](0,0)[/b] while intersecting the same line with [b](0,0)--(1,1)--(-1,1)--cycle[/b] will result in just one point. This is not a bug. These paths are also different from the viewpoint of the [b]fill()[/b] command: it refuses to run with the first path as an argument claiming that it is not cyclic but runs perfectly well with the second.

The next topic is long names of cse5 commands.

[b]Long names for cse5 commands[/b]. You, probably, wonder how to memorize all those one or two letter abbreviations CR, MP, D, IP, OP, etc. The secret is that each cse5 command has a nice long name that can be used anywhere in the code instead of the corresponding short name, the latter being just a natural abbreviation of the long name. Using long names improves the readability of the code for those who have never seen cse5 before and memorizing long names may be easier then memorizing the short ones but, of course, typing long names is more time-consuming and may easily create a code that exceeds the 2000 characters limit. You may want to go with long names if you have patience to type them and if your code is relatively short, so you do not need to squeeze a lot in one picture. Below is a full list of routine names in cse5:

[b]distance(A,B)[/b] or [b]d(A,B)[/b]. Returns the distance between two points given by the pairs A,B.

[b]Drawing(P,q,m)[/b] or [b]D(P,q,m)[/b]. Draws a path/pair P with pen q if real m is >0 and returns P. The last two arguments q and m are optional and are set to pathpen/pointpen and 1 by default.

[b]DrawPathArray(P,q,m)[/b] or [b]DPA(P,q,m)[/b]. Draws all paths in a path array P with pen q if real m is >0 and returns P. The last two arguments q and m are optional and are set to pathpen and 1 by default.

[b]MarkPoint(s,A,f,B)[/b] or [b]MP(s,A,f,B)[/b]. Marks (or, if you prefer, labels) a point given by the pair A by the string s written in the $\LaTeX$ font of size given by the integer f in the direction given by the pair B from the point and returns A. The last two arguments f and B are optional and are set to 11 and plain.S (south, or (0,-1)) by default.

[b]CirclebyRadius(A,R,a,b)[/b] or [b]CR(A,R,a,b)[/b]. Returns the path that is an arc of a circle centered at the point given by the pair A of radius given by real R from real a degrees to real b degrees. The last two arguments a and b are optional and set to 0 and 360 by default, in which case the full circle is returned as a cyclic path. Note that writing [b]CR(A,R,20,380)[/b] will result in an open path that also goes all the way around the circle but is not cyclic, so, you cannot fill it, say. You can write [b]CR(A,R,20,380)--cycle[/b], of course, to get a cyclic path that represents the same full circle but I see absolutely no reason for doing so.

[b]CirclebyPoint(A,B,a,b)[/b] or [b]CP(A,B,a,b)[/b]. Is equivalent (actually, is defined as) [b]CirclebyRadius(A,distance(A,B),a,b)[/b] or, if you prefer, [b]CR(A,d(A,B),a,b)[/b]. The last two arguments a and b are optional and their default values and interpretation is the same as in [b]CirclebyRadius[/b].

[b]Line(A,B,a,b)[/b] or [b]L(A,B,a,b)[/b] Returns the path that is a line segment passing through the points given by pairs A and B and extended by real a times the distance between A and B beyond A and by real b times the distance between A and B beyond B. The last two arguments a and b are optional. The default values are a=0.6, b=a.

[b]IntersectionPoints(P,Q)[/b] or [b]IPs(P,Q)[/b]. Returns the array of the common points for the paths in the path arrays P and Q. Note that a single path can always be cast into a path array of length 1 by Asymptote, so you do not need to care whether you use path P or path[] P as an argument.

[b]IntersectionPoint(P,Q,m)[/b] or [b]IP(P,Q,m)[/b]. Is basically equivalent to [b](IPs(P,Q))[m][/b] except it is foolproof. The last argument int m is optional and the default value of it is 0.

[b]OtherPoint(P,Q)[/b] or [b]OP(P,Q)[/b]. Is equivalent to (actually, defined as) [b]IP(P,Q,1)[/b].

The next topic is some DOs and DON'Ts.

[b]Five DOs and five DON'Ts[/b] This is not so much about cse5 as about what I consider good and bad habits concerning using Asymptote on AoPS. Valentin is welcome to correct me if he disagrees with my statements and add whatever he deems important to this post.

[color=green]DO[/color] design nice pictures illustrating your questions and solutions especially in the Geometry fora.
[color=green]DO[/color] encode your pictures with Asymptote.
[color=green]DO[/color] use subroutines for repetitive parts of your code.
[color=green]DO[/color] run your code on your home computer before posting to make sure it works as intended.
[color=green]DO[/color] learn Asymptote programming language and play with its various constructs at home.

[color=red]DON'T[/color]  try to describe complicated geometric figures in lengthy English sentences without any picture.
[color=red]DON'T[/color]  attach huge Word files.
[color=red]DON'T[/color]  post an erratic Asymptote code and try to correct it from the posting window.
[color=red]DON'T[/color]  post a code that takes a lot of time to execute or, worse, results in suspending Asymptote. This remark especially concerns very long or infinite loops.
[color=red]DON'T[/color]  use the site as a testing ground for unfamiliar Asymptote constructs (you are welcome to use the test forum for checking that something that runs well on your home computer runs equally well on the site, of course, but if you are trying something about which you are not 100% sure how exactly it will work, please, try it at home first).

I'd like to finish this manual with reproducing the most elaborate picture I've seen on the forum so far. The entire code is less than 1700 charachters long.
[asy]import cse5; size(500); pen d=dashed,b=black,g=grey,lb=lightblue,w=white,lw=linewidth(1); pair B=MP("B",D((0,0))),D=MP("D",D((3,0))),C=MP("C",D(3*dir(45))),E=MP("E",D(D+(0,1)*(D-C))), A=MP("A",D(IP(D(D--B--C,b),D(CP(D,C),red+d),1))),A1,G,F,H; D(C--D--E--C,b);D(L(B,D,0.3,1),g);D(arc(B,d(B,D),-95,95),blue+d); A1=MP("A^*",D(B-(0,1)*(A-B))); G=MP("G",IP(D(B--A1--A--D--A1,b+d),B--D,1),SE); void MA(pair X, real a, real c, string s, pen p, pair D=dir((a+c)/2)) { fill(arc(X,0.3,a,c)--X--cycle,p+w); MP(s,X+0.3*dir((a+c)/2),8,D); } MA(B,0,45,"45",lb); MA(D,22.5,112.5,"90",lb); MA(D,157.5,180,"22.5",g); MA(D,0,22.5,"22.5",g); MA(G,0,90,"90",g); F=MP("F",IP(E--(E.x,-E.y),L(B,D,1))); MA(F,90,180,"90",g); D(B--E--A, magenta+lw); D(F--E,b+d); H=MP("H",D(B+A-G,b)); D(B--H--A,b+d); MP("r",(G+D)/2); MP("r",(F+D)/2); MP("r(\sqrt 2-1)",(B+G)/2,6); MP("r(\sqrt 2-1)",(B+H)/2,6,W); MP("r(\sqrt 2-1)",(H+A)/2,6,N); MP("r(\sqrt 2-1)",0.4*G+0.6*A,6,plain.E); MP("2r",(A+E)/2,N); pair K=MP("K",D((6,-4))),I=MP("I",D(K-(2.5,0))),J=MP("J",D(K+2.5*dir(135)),N),L=MP("L",D((J.x,-4))); D(J--I--K--J--L,b); MA(I,0,67.5,"67.5",g); MA(L,0,90,"90",g); MA(K,135,180,"45",g); MA(J,247.5,270,"22.5",g,3*W); MP("r",(L+K)/2,7);MP("r",(L+J)/2,7,W);MP("r\sqrt 2",(K+J)/2,7,NE); MP("r(\sqrt 2-1)",(I+L)/2,7); draw((3.5,-3)--(2,-0.1),lw,Arrow); draw((4,-0.3)--(3.4,0.5),lw,Arrow); MP("\sqrt{(r(\sqrt 2-1)+r+r)^2+(r(\sqrt 2-1))^2}",(3.1,-0.5),7,plain.E); MP("=\sqrt{(r(\sqrt 2+1))^2+(r(\sqrt 2-1))^2}",(3.1,-0.8),7,plain.E); MP("=\sqrt{r^2(3+2\sqrt 2)+r^2(3-2\sqrt 2)}",(3.1,-1.1),7,plain.E); MP("=r\sqrt 6",(3.1,-1.4),7,plain.E); MP("\frac{BE}{AE}=\frac{r\sqrt 6}{2r}=\frac{\sqrt 6}{2}",(2,-3),16);[/asy]

This sounds like a stupid question I know, but is cse5 only on the site, if so, can you post it for download?

The link is [url]http://www.artofproblemsolving.com/Forum/latexrender/asy/cse5.asy[/url].  It was mentioned in another thread that got buried a while ago, and I've gotten tired of having to use the search every time I want to find the source code.

A small update: in the code on the forum you don't need to add [code]import cse5;[/code] in the beginning of the asy code anymore, it is automatically added ;)

I've started to wikify some of this stuff, which is good for future reference: [[Asymptote: CSE5]]
Is it possible to have the mark angle (MA) function take 3 parameters (pair center, pair starting point, pair endpoint) of the angle?

Wait, how do I actually use the package?
The download page is just a page of code.

[quote="Valentin Vornicu"]You just use the commands in the asy code. The package is automatically imported in any asy code you make on the site. The package file is there if you want to use asymptote on your local environment (for error checking, learning, creating eps files, etc.)[/quote]

What if I want to use in in Texnic Center?

Download the file cse5.asy (the link is given above), put it in the main Asymptote directory (usually C:\Program Files\Asymptote) and use the command import cse5; at the beginning of your asy file and compile as usual.

Looks like a problem on your end. I have no trouble with following it from my computer. :?

I can't seem to download the package? It just redirects me to http://www.artofproblemsolving.com/community

You have to copy paste the text into a txt file iirc

I meant that I couldn't even get on the page to copy and paste the text.

okay I'll post it here then. Make sure to make it a .asy file before putting it in your asymptote folder.

Hello,

Looking for an answer to post #26.

Thanks.

[quote=eduD_looC]Hello,

If I'm understanding this correctly, cse5.asy is intended to make it easier to write code? However, I'm looking at the code it looks less readable than normal asymptote without cse5.asy. Is there an explanation for this? (Does the readability come with more experience?)

Thanks.[/quote]

i mean it can be easier to write without being readable

[quote=eduD_looC]Hello,

If I'm understanding this correctly, cse5.asy is intended to make it easier to write code? However, I'm looking at the code it looks less readable than normal asymptote without cse5.asy. Is there an explanation for this? (Does the readability come with more experience?)

Thanks.[/quote]

Code written with the help of [b]cse5.asy[/b] can be made easier to read or to write when you use the long names which are defined at the end of [b]cse5.asy[/b]. Here one single example:

[asymptote]
//Basic routine long names
real distance(pair A,pair B)=d;
[/asymptote]

The intention of so very extremly short shortcuts (You see, here [b]d[/b] is standing as the abreviation for the word [b][u]d[/u][/b]istance) - which as sideeffect in the abreviated form makes code then so much hard to read or to write - must be seen with background which the author of [url=https://cdn.artofproblemsolving.com/attachments/7/e/e350141b2bbe34f6b9d75382c660ca7aba0913.txt][b]cse5.asy[/b][/url] explains like this (in [url=https://artofproblemsolving.com/community/c68h457127p2567924][b]post #8 [i]Olympiad Package[/i][/b][/url]):

[quote=fedja] [...] The same happened to cse5, which was written in response to the code length limit that is no longer there so I stopped supporting it despite I still like some ideas there like drawing commands returning the drawn objects, etc.[/quote]


No one care about this problem? It's too difficult or it's too easy?  Please help me to solve it!.

I did the problem with $x_{n+1}=\frac{1}{2006}(x_{n}^{3}-x_{n}^{2}+2006 x_{n})$
but i can't solve the above one.

Thanks very much for your help!


Let f \in Sn be a permutation. We say that f has k MAXIMS if exactly k elements from f are strictly greater then the all others which are in his left. Find how many permutation \in S_n with k MAXIMS exists.

:? I'd think this will depend on S_n :?

The strictly ascendant one is always ok, if there are 2 equal elements that's another permutation option...

This may be because of my dumbness :D but I think I don't quite understood the question...

yes... maybe i wasn't clear enough... i was teached to denote with Snall the permutations of {1,2,....,n} and i didn't think that you don't know this (so... i'm the dumb here):D

oic :)

well it's forgiven :P

I'll think about this one, nice problem!

Given a permutation (a1,...,an) of (1,2,..,n), we consider the sequence (b1,...,bn) where bi represents the quantity of numbers that are strictly bigger than ai, and appear on the left of ai on the permutation. So it follows that 0 \leq bi \leq n-i, for i=1,2,...n.
It's easy to prove that the sequence (b1,...,bn) defines a unique permutation (a1,...,an). So the number we are looking for is the number of sequences (b1,...,bn) in wich there are exacly k zeros. From here on I don't know how to calculate it. If anybody can, please post it, I really want to know the result :D

In order for a particular permutation p with k MAXIMS to exist, we need to have a strict ordering of the natural numbers into 2 sub-permutations A and B such that (A|B)=p. Note that for any natural a\inA and b\inB, a<b. Since there are B contains k elements because p has k MAXIMS, then A must contain (n-k) elements. The ordering of the elements in both A and B are important and therefore the number of permutations in A is (n-k)! and the number of permutations in B is k!. So the number of permutations with k MAXIMS is k!*(n-k)!.

Query: For a similar challenge do the following problem: Suppose that p\inSn is a permutation of n naturals. Call a pair [i]funny[/i] if for each pair of adjacent elements pj and pj+1 in p, pj<pj+1. Find the number of permutations with k [i]funny[/i] pairs, for any n>2k.

PS: Hi Leonardo. Welcome to mathlinks. Are you from Caracas? Hehe just wondering. Hasta luego (it means cya).

I think you have a mistake, you say:
  "The ordering of the elements in both A and B are important and therefore the number of permutations in A is (n-k)! and the number of permutations in B is k!"
 But this you cannot do, cuz then you have to consider that you're counting permutations in A that have Maxims, apart from the ones you are already counting in B. I still don't know how to get a nice approach to problem  :?

[quote="Kuba"]Let f \in Sn be a permutation. We say that f has k MAXIMS if [b]exactly[/b] k elements from f are strictly greater then the all others which are in his left. Find how many permutation \in S_n with k MAXIMS exists.[/quote]
Oops my bad :blush: , he meant [b]exactly[/b] k elements...
Here is my fix to the loophole: basically the idea is almost the same.
Elements of A consists of 1,...,n-k and arrange them in descending order like this:
(n-k, n-k-1, n-k-2, ... , 3, 2, 1, B), where B is a permutation of (n-k+1, n-k+2, ... , n)
Clearly A has no MAXIMS  :D . Also all elements of B are strictly greater than all the elements to the left. This is a much easier answer. :cool:
I would like to ask Peter to finish my solution :D For some reason, I like him a lot. :P  ;)


I'm kinda stuck here on 2 problems guys. Hope you can help me out. I'll give the first problem first and if someone can explain it to me then I'll give the second one too because I dont want to ask for too much.

A metal door is made up of 2 parts. The first part is made up of Iron, the second part is made up of Zinc. Each cm of the Iron part weighs 9 kg. Each cm of the Zinc part weighs 15 kg. The Zinc part is 11 cm shorter then the Iron part. The door weighs 840 kg in total. How long is the Iron part?

The teacher gave me an equation to help guide me but I have to fill in the blanks.

9 (x-11) + (   ) = (   )

Thanks in Advance guys!

[b][u]Answer: 41.875[/u][/b]
Just set up a system of equations and solve for Iron.
- Since the Zinc part is 11 cm shorter than the Iron part you know that Z = I -11
- Each Iron part weighs 9kg and each Zinc part weighs 15kg, since they add up to 840 kg you know that
  9I + 15 Z =840.
- Substituting in for Z you end up with 24I - 165 =840. Isolate the I by adding 165 (1005) and then dividing by 24 (335/8 or 41.875).

I hope you can understand my thought process if you couldn't just send me a PM and I'll try to help you.

Thanks man.. Here's the 2nd one.

In a chocolate factory we use 2 machines to make chocolate. The first machine produces 18 kg of chocolate every minute. Whenever the first machine starts having problems, we use the second machine. The 2nd machine produces ? kg per minute.

Half way through this week,  the first machine stopped working and we had to use the second one. The making of chocolate that week lasted 480 minutesi n total. The 2nd machine produces 180 kg of chocolate more then the first. How long did the 1st machine work this week? Here's the equation the teacher gave us to fill in.

12x - 18 ( )= 180

Sorry, didn't see you new post well here's what I got.
Using your teachers equation 12b-18a=180 (18a is the amount of chocolate the first machine made) and the other equation from the text b + a = 480 we just do what we did on the last problem. (You might want to simplify the top equation at the beginning). You'll come up with the answer.

[hide][b][u]Answer: First machine worked for 186 minutes or 3 hours and 6 minutes.[/u][/b][/hide]


Prove that, for any positive integer m, there exist m consecutive integers which cannot in the form x + y for positive integers x, y.

Let N = km for some positive integer k.
Let E(N) be the set of the positive integers not greater than N and of the form x 2  + y^3 for some positive integers x,y.

- If there does not exist m consecutive integers, then there must be one element of E(N) in each of the set {tm+1, tm+2,...,(t+1)m} for each t=0,...,k-1.
Thus, since these k sets are pairwise disjoints, we must have |E(N)| >= k = N/m.  (1)

- In another hand, if x 2  + y^3 =< N where x,y are positive integers, then 1 =< x < N^(1/2) and 1 =< y < N^(1/3). Thus, |E(N)| < N^(1/2)*N^(1/3) = N^(5/6).  (2)

From (1) and (2), we deduce that choosing N such that N^(5/6) < N/m, which is clearly possible (that is N > m^6 i.e. k > m^5), will ensure that there will be m consecutive positive integers not greater than N non of the form x 2  + y^3.

Pierre.


[quote="learningfish"]Christin's age is equal to three times her age in three years' time minus three times her age 3 years ago?  :)

Is she: 10, 12, 15 or 18?

and how do you solve this???

Maybe... 3(x - 3) - 3(x - 3)[/quote]

Actually it says "in three years' time" so it would be $3(x+3)-3(x-3)$.

set her age as $x$

$x= 3(x+3)-3(x-3)$

$x= 3x+9-3x+9$

$x= 18$

she is 18 years old

[quote]Maybe... 3(x - 3) - 3(x - 3)[/quote]
this would make her zero
make sure you think through your ideas

[hide]Basically set up the equations
$3(x+3)-3(x-3)=x$
$3x+9-3x+9=x$
$18=x$

So [b]x=18.[/b][/hide]

Set her age to x.
[b]x = 3(x+3) - 3(x-3)
x = 3x + 9 - 3x + 9
x = 18
Christin is 18 years old.[/b]

[quote="toadoncart"]18 years old....  :ninja:[/quote]
Please use hide commands, and post a solution.

the equation is 3(x+3)-3(x-3)=x
thus
3x+9-3x+9=x
and:
I don't know how to use hide commands so I can't put the answer down here.
:-P

Hide command:
[hide]whatever you want here[/hide]

You can also just type your solution first, highlight it, and click the little button above the typing space that says "hide".

This question has already been answered a lot, and it's getting off topic.  We all agree the answer is [hide] [b]18[/b] [/hide]

i usually don't like to hide, only sometimes, and I do the solution on paper, because typing the solution on computer is annoying. secondly, my post ain't on there no more!  :rotfl:


i didnt give either my recommenders a 'code' that you get from registering online. [since i just started that process] and they've both turned in their letters.
so what should i do now??

How exactly did they turn in their letters without the codes?

[quote="shelly32494"]they emailed/mailed it.....[/quote]

That's OK.  Note it in your application.

Good luck!


See the attachment. Why is this happening (the 0 to the right of middle school contests)? Also, the topics were cleaned out (I think).

It's the same in the AoPS website as well.

Hmm...I don't have that.
Maybe it was fixed?


How do I prepare for MC state? I have it this Saturday.

I know this has been posted many times, but I don't want to revive old topics.

Do I
1) Do like 10 tests
2) Last-minute cramming
3) Program everything on my ti
4) All of the above

With only a few days left to go, here's what I'd suggest, for what it's worth.  Go through old tests and problems you've solved recently and see if there are a few things that you mess up on consistently, and try to do some concentrated practice in those areas.  Also read solutions for problems you have missed, and try to understand them.

If there are a few things you want on your TI, get them on there.  Practice using them.  Others may advise what they think is worthwhile.

Get a good night's sleep Friday night, and try to relax and do your best on Saturday.  Don't get psyched out.  If the test seems easy, whoever makes the fewest stupid mistakes will win.  Check your work carefully.  If the test seems hard, remember that it's probably also hard for everyone else, so don't give up.  Do your best, read problems carefully, underline key words, and make sure you answer the question they really asked.

Good luck!


inequalities
calculus
integration
real analysis
real analysis unsolved

Let $ \displaystyle a_{1}, a_{2}, \ldots, a_{n}$ be positive real numbers. Prove that
\[ \displaystyle\sum_{i\equal{}1}^{n}\frac{a_{i}}{i}\sum_{1\leq i, j\leq n}\frac{a_{i}a_{j}}{i\plus{}j}\leq\sum_{1\leq i, j, k\leq n}\frac{a_{i}a_{j}a_{k}}{i\plus{}j\plus{}k}.\]

$ \boxed{\frac{1}{m}\equal{}\int_0^1 x^{m\minus{}1}\ dx}$


trigonometry
geometry
function
algebra open
algebra

Here's the problem:
[b]Find a curve (not a multiple/translation/etc. of sine and the like) $ C$ such that for all points $ P$ on $ C$, the line through the origin and some $ P$ intersects the graph of $ y \equal{} \sin{x}$ exactly once.
[/b]

I came up with this problem myself, so I don't know if there's an answer. Also, I couldn't decide whether to put this here or in the Geometry section.

I thought that a possible route to solve this could be via finding a function $ f: \mathbb{R}^\infty \to \mathbb{R}$, such that $ \forall u \in \mathbb{R}^\infty,\ \exists ! (x,y) \in \mathbb{R}^2$ such that
\[ \begin{cases} y \equal{} \sin{x} \\
y \equal{} {f(u) \over u} x \end{cases}
\]

A line through the origin intersects $ y \equal{} \sin x$ at $ (0, 0)$, and it's easy to find $ C$ that is always above the curve $ y \equal{} \sin x$, so I'm not sure what you're trying to say.


geometry
incenter
inequalities
inequalities proposed

Let $ G$,$ I$ be the centroid and incenter of triangle $ ABC$
Prove that $ AG\plus{}BG\plus{}CG\ge AI\plus{}BI\plus{}CI$

It was proved by Zhen Wang in 1994, see:

Ji Chen, Congjie Chen, Linear inequalities in a triangle (Chinese), [url=http://www.docin.com/p-8039206.html]Geometric Inequalities in China (Edit by Zun Shan, Ji Chen, Yao Zhang, Shiguo Yang)[/url], Jiangsu Education Publishing House, 1996, pp. 87-110.

See also : http://www.mathlinks.ro/viewtopic.php?t=126397

[b]HINT: [/b]$ \sum{GA}\ge\sum{IA}\Leftrightarrow\sqrt {a \plus{} b \plus{} c}.\sum{\sqrt {2.\left(b^2 \plus{} c^2\right) \minus{} a^2}}\ge3.\sum{\sqrt {bc.(b \plus{} c \minus{} a)}}$


I haven't actually tried writing down a solution to this, but I'm pretty sure I know a method. Anyway, try this:

Given any polynomial with real coefficients,  f(x), prove that if f(x)>=0 for all x, then you can write f(x) as the sum of squares of polynomials with real coefficients.

(ok, so the subject should be non-negative ;))

[url=http://mathworld.wolfram.com/LagrangesIdentity.html]Langrange's identity[/url] implies that it's enough to prove that f can be written as the [b]product [/b]of the square of two polynomials.

Now it's easy   :)

* From d'Alembert-Gauss theorem :

f(x) = a * :prod: (x-ai)^ui * :prod: (x^2 + 2bj*x + cj)^vi

where ai are the real roots and the (x^2 + 2bj*x + cj) are irreductible polynomials over R[X] (if z is a complex root the conjugate of z is also root ...).

* a > 0 otherwise for x large enough, f(x) would be < 0.

* all the ui are even otherwise near ai f(x) would change its sign.
a * (x-ai)^2 =  :sqrt:a * (x-ai)^2 + 0

* (x^2 + 2bj*x + cj) = (x + bj) + ( :sqrt: (cj-bj))^2 : bj-cj < 0 because (x^2 + 2bj*x + cj) has no real roots.

QED.


A circle having center $ (0,k)$, with $ k > 6$, is tangent to the lines $ y \equal{} x, y \equal{} \minus{} x$ and $ y \equal{} 6$. What is the radius of this circle?

$ \textbf{(A)}\ 6 \sqrt 2 \minus{} 6\qquad
\textbf{(B)}\ 6\qquad
\textbf{(C)}\ 6 \sqrt 2\qquad
\textbf{(D)}\ 12\qquad
\textbf{(E)}\ 6 \plus{} 6 \sqrt 2$

[hide]Let $A$ be on the line $y=x$ that is tangent to the circle, and let $B$ be on ht eline $y=-x$ that is tangent to the circle. Let $C$ be the center of the circle.

Let $A(p,p)$ $\longrightarrow$ $B(-p,p)$, $C(0,2p)$
($A$, $B$, $C$, and the origin form a square.)

So we have $r=AC=\sqrt{2}p$.
In addition, since $y=6$ is also tangent to the circle, the distance between $C$ and $y=6$, which is simply $2p-6$, is equal to $r$.

Solving the system $r=\sqrt{2}p$ and $r=2p-6$, we obtain $r=6\sqrt{2}\pm 6$. However, $r=6\sqrt{2}-6$ is when $k<6$, so the answer is $6\sqrt{2}+6$.[/hide]

Sorry, I didn't read the problem correctly :oops:  Edited.

[hide]

Drawing a diagram, we see that from the point of tangency to  to the intersection with  is 6, so the distance from that point to the tangency on  is 6 (tangents are equal). Thus, from the origin to the point of tangency on  is . In addition, the distance from the origin to the point circle is , and following the secant through the circle ot the other end, it's . By power of a point, . Solving, we get .

[/hide]

I'm bad at geometry so can you tell me how you got that the distance for $y = x$ to $y = 6$'s tangent point of circle is 6?

The tangent at y=6 is going to be at (0,6). Then the distance from that point to the intersection of y=6 and y=x (not the circle tangency to y=x) is just moving horizontally until x=y, which is at (6,6). That's only a horizontal slide of 6. Then we can say that from that intersection of the two lines to the tangency on y=x is also six, because tangents to a circle from the same point are always equal.

[quote="Silverfalcon"]Oh duh. Thanks.  :)[/quote]

[hide]Equally easily, you could note that line y = x intersects the xy axes at a 45-degree angle. Thus the radius of the circle and segment formed by the line y = x going from the origin to the tangency of the circle are equal b/c of the 45-45-90 triangle formed by the center of the circle, the tangency of line y=x and the circle, and the origin.

Thus if we let radius = r, we have $r\sqrt{2} = 6 + r \Rightarrow r = \frac{6}{\sqrt{2} - 1} = 6\sqrt{2} + 6$. :D[/hide]

Of course, the distances from the center to each of the lines are equal. The distances from the two slanted lines are obviously equal by symmetry, so it suffices to solve \[ |k\minus{}6|\equal{}\frac{ |(0)(\minus{}1)\plus{}(k)(1)\plus{}0|}{\sqrt{(\minus{}1)^2\plus{}(1)^2}}\]
This gives $ \sqrt{2}|k\minus{}6|\equal{}k$. But $ k > 6$, so $ \sqrt{2} k\minus{}6\sqrt{2}\equal{}k$, or $ k\equal{}\frac{6\sqrt{2}}{\sqrt{2}\minus{}1}\equal{}6\sqrt{2} (\sqrt{2}\plus{}1)\equal{}6\sqrt{2}\plus{}12$. We want to find the radius, which is $ k\minus{}6$ or $ 6\sqrt{2}\plus{}6$, giving $ E$.

Another easy way is to note that if you connect the center of the circle to the tangent points of y = x and     y = -x, the two lines and the radii to them form a square, so therefore, the distance from the origin to the cneter of the circle is the diagonal of the square.  From there you label the radius X, and figure out that the x(sqrt2)-x=6.  Solve for it,  divide by X on both sides for 6/x= sqrt2-1, divide by six and take recipricals.


algebra
polynomial
Rational Root Theorem

Let k be an integer. Find the sum of all distinct k such that the equation x^3+2x^2+kx-3=0 has at least one rational root for x.

By rational root theorem we can only have x = 1,3,-1,-3.

Try x = 1:  then k = 3.

Try x = 3:  then k = -14.

Try x =-1:  then k = -2.

Try x =-3:  then k = -4.

The sum is -17.

I think you made a little mistake there
when x=1 k should be 0


function
modular arithmetic
number theory
relatively prime
totient function

Compute the remainder when $2^{2007}$ is divided by $1000$.

Huh?

Can you explain more slowly and show all the steps?

You may want to take a look through [url=http://www.artofproblemsolving.com/Forum/viewtopic.php?t=138253]this thread[/url]. It is essentially an application of Euler's Totient Formula.

The linked thread doesn't explain how to use Euler's Totient Function.  Also, how do you figure out what $\phi(n)$ equals?

It can be calculated using:
$\varphi(n)=(p_{1}-1)p_{1}^{k_{1}-1}\cdots (p_{r}-1)p_{r}^{k_{r}-1}$

Note that for relatively prime $a$ and $b$, $\varphi (ab) = \varphi(a) \varphi (b)$

Euler's Totient Function says that $a^{\varphi (n)}\equiv 1 \pmod{n}$ for $a$ coprime to $n$.

This can be used to find the period of repetition of $a^{k}$ in mod $n$, and a bit of fooling around will show you how to do it if $a$ and $n$ are not coprime, also (this particular situation is what that thread discusses).


Let $ a_1,a_2,\ldots,a_n$ be positive real numbers. Consider the following inequality
\[ \sum^{n}_{k \equal{} 1} a^{\frac {k}{k \plus{} 1}}_k \le \sum^n_{k \equal{} 1} a_k \plus{} k_n \sqrt {\sum^n_{k \equal{} 1} a_k}
\]
1. Prove the the inequality holds for all $ k_n \ge \frac {\sqrt {2(\pi^2 \minus{} 3)}}{3}$.
2. $ (\bigstar)$ Determine the least value of $ k_n$ such that the inequality holds.

I think this one is difficult, hope that there's exists an elementary solution :maybe:

[quote="vanhoadh"]I think this one is difficult, hope that there's exists a elementary solution :maybe:[/quote]
For a), there exists a nice proof with AM-GM. :)

Who and why moved this topic into the temp forum?

[quote="can_hang2007"]Let $ a_1,a_2,\ldots,a_n$ be positive real numbers. Consider the following inequality
\[ \sum^{n}_{k \equal{} 1} a^{\frac {k}{k \plus{} 1}}_k \le \sum^n_{k \equal{} 1} a_k \plus{} k_n \sqrt {\sum^n_{k \equal{} 1} a_k}\]
1. Prove the the inequality holds for all $ k_n \ge \frac {\sqrt {2(\pi^2 \minus{} 3)}}{3}$.
2. $ (\bigstar)$ Determine the least value of $ k_n$ such that the inequality holds.[/quote]
The inequality with $ k _n\equal{} \frac {\sqrt {2(\pi^2 \minus{} 3)}}{3}$ is [b]Problem 6.38 - page 312[/b] in new book:

Vasile Cirtoaje, Vo Quoc Ba Can, Tran Quoc Anh, [url=http://can-hang2007.blogspot.com/2009/12/new-book-inequalities-with-beautiful_20.html][i][b]Inequalities with Beautiful Solutions[/b][/i][/url], GIL publishing house 2009.


[hide="Solution"]
This is quite easy if u notice that $ x^{2}-2x+3\geq 2$ for all $ x$, hence it must be: $ x^{2}-2x+3=2 \wedge x^{2}-3x+2=0$, so only $ x=1$ is the solution.[/hide]

[quote="riddler"]Nice... I was thinking would it be possible to apply Fermat's last theorem and say that either must be 0...[/quote]
But Fermat's Last Theorem only works for $ \mathbb{Z}$. There might be other solutions.


Write $ 2009^{2010}$ as the sum of six distinct perfect squares.

I'm not sure if this is right, as I posted in the other thread. Could someone check if this makes sense?
[hide]
$ 2009^{2010}\equal{}(7^{2010}*41^{1005})^2$
$ (7^{2010}*41^{1005})^2\equal{}(7^{2010}*41^{1004}*9)^2\plus{}(7^{2010}*41^{1004}*40)^2\equal{}(7^{2010}*41^{1004}*9)^2\plus{}(7^{2010}*41^{1003}*40*9)^2\plus{}(7^{2010}*41^{1003}*40*40)^2$

(breaking up the last term).
We can keep breaking up the last term into two more addends until we have the six squares we need. All of these squares will be distinct because each one will have one more factor of 40 than the previous one.[/hide]

I may not be seeing something obvious, but why 9 and 40?

[hide]
9, 40, 41 pythagorean triple.

Like, $ (9x)^2\plus{}(40x)^2\equal{}(41x)^2$[/hide]

I think your solution works. That is good use of the Pythagorean Theorem.

As a comment, at some point you may want to think about the presentation of your proofs. In particular, what is actually going on in your proof?

Essentially, you said well look

Suppose $ d^2\equal{}a^2\plus{}b^2$.

Then $ d^4\equal{}d^2a^2\plus{}d^2b^2\equal{}d^2a^2\plus{}(a^2b^2\plus{}b^2b^2)$

So $ d^{2k}$ is the sum of $ k\plus{}1$ squares. Taking $ d\equal{}41$ and $ k\equal{}5$, and the fact that $ 41,40,9$ are pairwise relatively prime gives you that they are distinct.

Then you use the idea that if $ a$ is the sum of squares, then $ x^2a$ is also a sum of squares.

It is a nice idea that generalizes well. Your proof is correct but I'd also think it would be worthwhile to flesh out the ideas that you are using.


Cassandra sets her watch to the correct time at noon. At the actual time of $ \text{1: \!\,00 PM}$, she notices that her watch reads $ \text{12: \!\,57}$ and $ 36$ seconds. Assuming that her watch loses time at a constant rate, what will be the actual time when her watch ﬁrst reads $ \text{10: \!\,00 PM}$?

$ \textbf{(A)}\ \text{10: \!\,22 PM and 24 seconds} \qquad\textbf{(B)}\ \text{10: \!\,24 PM}\qquad\textbf{(C)}\ \text{10: \!\,25 PM}$
$ \textbf{(D)}\ \text{10: \!\,27 PM}\qquad\textbf{(E)}\ \text{10: \!\,30 PM}$

Edit: Never mind,
plz ignore this post.

I did not read the question properly.

The equation when $ y$ is the watch time and $ x$ is the real time is $ y \equal{} 60x \minus{} (2x \plus{} \frac {24}{60}x) \equal{} \frac {288x}{5}$ with x in hours and y in minutes. Thus we have to find the time when $ y \equal{} 600$. This gives $ x \equal{} 125/12$ or $ 10: 25$.

[hide="Solution"]
When it is $ 1: 00$ PM it's $ 60$ minutes past noon, but Cassandra's watch records only $ 57$ minutes and $ 36$ seconds, or $ 57.6$ minutes.  Thus, when her watch has recorded $ t$ minutes past noon, the actually number of minutes passed is $ \frac{60}{57.6}t\equal{}\frac{25}{24}t$.  When her watch reads $ 10: 00$ PM, it's recorded $ 600$ minutes past noon, so the actual number of minutes past noon is $ \frac{25}{24}(600)\equal{}625$ minutes or $ 10$ hours, $ 25$ minutes.  Thus, the real time is $ 10: 25$ PM, which corresponds to answer choice $ \boxed{\textbf{(C)}}$.
[/hide]

Hope I helped!

I did this a little differently:
After $ 60$ minutes, Cassandra's watch lost $ 144$ seconds.  In other words, for every minutes on a correct watch, Cassandra's loses $ \frac{36}{15}$ seconds.  So, after $ 25$ seconds on a correct watch, Cassandra's loses $ 1$ seconds.  Or, we can look at it as after $ 24$ seconds on Cassandra's watch, a correct watch has gained $ 1$ second.  At $ 10: 00$ on Cassandra's watch, $ 36000$ seconds have gone by.  Therefore, the correct watch has gained $ \frac{36000}{24}\equal{}1500$ seconds.  This is equivalent to $ 25$ minutes.  Hence, at $ 10: 00$ on Cassandra's watch, it is really $ 10: 25$.


topology
geometry
geometric transformation
reflection
linear algebra
matrix
symmetry

Here are some algebraic topology problems from [url=http://www.math.cornell.edu/~hatcher/AT/ATpage.html]Allen Hatcher's book[/url] that I am struggling with.

12. For the computation of $ \pi_1(X)$, I can visualize how to continuously deform X into the wedge of two circles but I'm guessing that Hatcher is looking for something more rigorous than that. To compute $ \pi_1(Y)$, I was trying to use van Kampen with a cover by 3 open sets. I think one of the open sets should be a small neighborhood of the circle of self-intersection which would have fundamental group $ \mathbb{Z}$. I was having trouble getting two other sets that were open and where all the intersections were path-connected... Any ideas?

20. The fundamental group of the infinite wedge sum is the free product of infinitely many copies of $ \mathbb{Z}$. This can be shown by covering the space with a small neighborhood of the wedge point and then each of the circles unioned with the small neighborhood. Then apply van Kampen noting that all of the intersections are trivial. There is no reason why this same argument wouldn't work for the space described, so that proves the first part. The second part is more difficult I think. The only candidates for homotopy equivalences I can think of between the two spaces are those that take the circles to each other one by one. So either this is continuous both ways in which we have a homeomorphism or neither is continuous they cannot be homotopy equivalences...what am I missing?

My favorite approach for getting at the fundamental group of the Klein bottle: it's isomorphic to the group of symmetries of the universal cover. That universal cover is $ \mathbb{R}^2$, with $ (x,y)$, $ (x\plus{}1,y)$, and $ (\minus{}x,y\plus{}1)$ all preimages of the same point; we get this by taking the usual picture of a square with opposite sides identified (one pair twisted) and tiling the plane.

The group of symmetries is thus generated by the translation $ T$ and the glide reflection $ R$ shown above. They are related by $ TR\equal{}RT^{\minus{}1}$.
That's a presentation of the group. It's also straightforward to embed it in a matrix group.

The justification for the above: The universal cover for a manifold $ M$ is a covering map $ \phi$ from a simply connected space $ S$ to $ M$. The symmetry group $ G$ acts on $ S$, fixing $ \phi$. Now, take a loop in $ M$ based at $ p$ and lift it as a path to $ S$. That loop is homotopic to the identity in $ S$ if and only if both ends lift to the same point in $ \phi^{\minus{}1}(p)$- and we can lift a homotopy in $ M$ to a homotopy in $ S$.
That gives us a 1-1 correspondence between the elements of the fundamental group and the points in $ \phi^{\minus{}1}(p)$. Writing $ \phi^{\minus{}1}(p)\equal{}G\cdot P$, we have a correspondence between the group and $ G$. Finally, concatenation of loops fits with the group operation: if $ A$ starts at $ P$ and ends at $ gP$, while $ B$ starts at $ P$ and ends at $ hP$, $ A*gB$ goes from $ P$ to $ gP$ to $ ghP$ and maps down to $ \phi(A)*\phi(B)$.

This is all a completely different approach from what you were trying. It's not so nice in general because it's rarely so easy to describe the universal cover.

But $ X$ is not the Klein bottle. Its a subspace of $ \mathbb{R}^3$.


[quote="richard"]On the page 8 of the book Programming Challenges, there is a Pascal program. Its first line is {N+}. What does it mean?[/quote]

Compiling with numeric coprocessor 8087 'on' (N+), this is very useful in the "old" day using before 80486.