# HP Forums

Full Version: University of Houston Calculator Contest
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

The following appeared on comp.sys.hp48 recently. I thought this community might enjoy it. Please note that I was not the orignal poster.
----------------------------------------------------------

I came across an interesting site for the annual University of Houston
Mathematics Contest for high school students (http://
mathcontest.uh.edu/). One of the contests is a calculator test. I
tried the 2009 test:

It was interesting. The 20 questions range from reasonably easy to
downright hard to completely ridiculously and confusing.

The contest is supposed to be one hour, but I took closer to two.
Unfortunately, after I finished, I realized that there is no answer
key given, so I couldn't check my results, but it was still a fun
challenge.

Enjoy,
-wes

Eeek, that test would be quite a challenge in an hour.

A high end graphing calculator would help a lot evaluating the relatively long series.

- Pauli

If you look at the chapter names of the PDF (I viewed it with Preview on my Mac) a TI-83 is recommended.

I didn't do the whole thing, but here are most of them.

1. << 950774 DO 1 - DUP ISPRIME? UNTIL END>>

Gives

950753

2. 5*7^5+5*7^4+2*7^3+4*7^2+2*7+6=552426

Straight forward; I probably should have written a program to make it go a little faster.

3. This one is based on Euler's constant.

exp(7.2-0.577) = 752

You can then manually find the sum
to 752 = 7.200616
to 751 = 7.19928

752

4
900/(pi/2) = 572.95

571 * pi/2 = 896.9247...

3.4287130x10-6

5. By graphing, we find they intersect at 1.2476143603 and -3.39730397
so
-2.14968960968

6. Derivative has real roots -.707250032311, -4.29559733134, 4.61929258455

f has values -362.723, 104704.599751, 232366.502395

can be confirmed with graphing

232366.5023

7.
7351344 = 2^4 * 3 ^ 3 * 7 * 11 * 13 * 17

11 factors

You can include or not include any of them. (2^11 values of i)

so 2^22 points

8. <<1 1 14 FOR X 3 X ^ INV 1 + X 1 + ^ * NEXT>>

9.
Use DROITE, the line is Y = 1/3(x-7)+4

take the atan

10. -2689/890=-3 19/890

Might be slightly more difficult to get an exact answer if your calculator does not have a CAS; otherwise this is trivial.

11. 310,000.00 I must not get this one. It seems like a simple division problem. Maybe it's a trick question.

12.
There are 47 years

<< 71 1 47 FOR X DUP .06 * FLOOR + NEXT >>

Gives 980 (would have been 1098 without the FLOOR), then subtract 39

14.

<< 1 0 0 -> X S J
<< 2 47 FOR J
J ISPRIME?
IF THEN X 1 + 'X' STO X 2 / DUP FLOOR ==
IF THEN X 1 + DUP 2 ^ + 2 / J * S + 'S' STO
END
END
NEXT
S
>>
>>

15
<< .5 2 51 FOR X DUP 1 SWAP - * 3 * NEXT >>

16
<<0 1 200 For X X ISPRIME? IF THEN X INV 2 ^ + END NEXT>>

I also confirmed that there are as many primes as there were supposed to be.

17. Solve e(-x^2) = 10^-9
x=4.55228138815
Odds of being right for on‌e = 1-4.55../9 = 0.494...

Odds of being right for all 10 is that to the 10th power.

8.6885627195x10-4

Quote:
7. 7351344 = 2^4 * 3 ^ 3 * 7 * 11 * 13 * 17

11 factors

You can include or not include any of them. (2^11 values of i)

so 2^22 points

I already see that I did that totally wrong.

It's

5 * 4 * 2 * 2 * 2 * 2

(The prime exponent plus 1)

so 320 factors.

And 10240 points.

19.

This is much easier than it first seems.

The square root of 1100 is 33.1...

The 25th prime is 98.

That means if any number less than 1100 is not divisible by the first 25 primes then it itself must be prime.

<< 0 -> X

<< 2 1100 FOR J

J ISPRIME? IF THEN X 1 + 'X' STO END NEXT X >> >>

That gives 184 primes less than 1100

It would be harder if they asked if they weren't divisible by, say, the first 5 primes (up to 11). Then you'd have to include numbers like 13^2=169, 17^2=289, 13*17=221, etc.

Quote:

I already see that I did that totally wrong.

It's

5 * 4 * 2 * 2 * 2 * 2

(The prime exponent plus 1)

so 320 factors.

And 10240 points.

102400 actually. You missed a zero. But thanks for the solution. I did it completely wrong, in a complete different way from either your right answer or your wrong one. I thought they were plotting only the prime factors.

13. I really hated this one. It's not a math problem; it's a "can you penetrate our impenetrable writing" problem. Too bad those being judged can't sometimes turn around and judge the judges.

Anyway, I guess the idea is that to 6 pm she has gone 67 mph for 2 hours, so she's gone 134 miles. For the next 40 minutes she's able to drive the full 75 mph, so that gets her another 50 miles ahead, for 184 total. I presume that for 25 minutes she just drove in a big circle, so at 7:33 she's still 184 miles from Houston (and 55 from Dallas). Then for 20 minutes she drove for 64 mph, getting her another 21.333... miles ahead. So, it's now 7:53 and she has 33.666... miles to go. She can go that distance at 75 mph, so it takes her 0.448888... hours = 26.93333.... minutes to go the rest of the way.

17. I already answered this one, but just as a note, they never specified that the trial numbers would be chosen with uniform random distribution in the interval.

18. We could do this with a financial function trivially if not for the alternating deposits. There are 126 6-month periods in 21 years.

<< 0 1 126 FOR X 1 .04 12 / + * 600 + 1 .04 12 / + * 900 + NEXT >>

A refinement could be to round down fractions of a penny.

If it wasn't for the compound interest, the total would have been 189000.

"Crawl" --

Thanks for your answers. Certainly, a modern calc with built-in graphing, fast processing, and mathematical functions such as prime number and maybe LCM, LCD, etc. would helpful for this exercise.

Still, even a venerable HP-34C, HP-11C, or HP-15C is useful for some of the problems requiring more than straightforward transcedental functions:

Question 3

Find the smallest natural number k so that 1 + 1/2 + 1/3 + 1/4 + ... + 1/k > 7.2

I'd forgotten all about the Euler-Mascheroni Constant, which had been discussed in the Forum, and was surely was intended to be utilized for analyzing this harmonic series. As "Crawl" pointed out, the "rate of divergence" equation will give a very accurate estimate of k. However, ignoring the error 'epsilon' in the equation will lead the user to assume that the correct answer is 753, not 752 (for which 'epsilon' is about 0.00072418).

Directly-calculated solution -- the sum is not too difficult to automate using ISG:

```Program:          Execution:
LBL A             1.99901
RCL I             STO I
INT               7.2
1/x               GSB A
-                 ...
x < 0?            RCL I
RTN               INT
ISG (or ISG I)    (752.)
GTO A
RTN
```

Question 5

Give the sum of the x coordinates for the points of intersection of the graphs of

f(x) = sin(x) + 2x

g(x) = 5 - x2

SOLVE in the HP-34C and HP-15C will tackle this, but they will find only one root at a time, so the guesses that define initial search ranges must be selected intelligently. Don't forget RADian mode:

```Program:    Execution:
LBL B           0
2               2
+            SOLVE B
*          (1.247614363)
5             STO 0
-              -3
x<>y          ENTER
SIN            -4
+            SOLVE B
RTN        (-3.397303973)
RCL+ 0
(-2.149689610)
```

Question 6:

Approximate the largest value of f(x) = -x8 + 787x4 + 673x3 + 521x2 + 840x + 12.

-x8 is a symmetrical term dominant for larger-magnitude values of x, reducing the sum of the remaining terms (except at x = 0). Since all the coefficients for the lower-order terms are positive, it's reasonably clear that, when x > 0, the lower-order terms all contribute positively in a monotonically-increasing sum, providing the maximum function value. Therefore, there is indeed only one root for the derivative of the complete function for x > 0, indicating a local maximum; the largest value is the function evaluated at that point.

Using SOLVE between 0 and 10 to find the root of the derivative yields 4.619292584, consistent with what "Crawl" found. Programming the derivative using Horner's Method will speed things up:

```Program:     Execution:
LBL 0            0
*              ENTER
*               10
*             SOLVE 0
-8              ...
*            (4.619292584)
3148           ENTER
+              ENTER
*              ENTER
2019             *
+                *
*                *
1042            CHS
+               787
*                +
840              *
+               673
RTN              +
*
521
+
*
840
+
*
12
+
(232,366.5024)
(coefficients merged for clarity)
```

Question 10

Give the y coordinate of the solution to the system

``` 31x - 29y = 43
-51x + 19y = 16
```

in reduced fraction form.

The approach, of course, is to utilize

```    [a  b]       1      [ d -b]
inv |    |  = ------- * |     |
[c  d]    ad - bc   [-c  a]
```

and multiply to solve for x and y.

Answers can be checked with the HP-15C determinant and matrix solutions.

-- KS

Edited: 9 Nov 2009, 1:17 a.m.

Crawl,

Thank you for the excellent answers.

Quote:
1. << 950774 DO 1 - DUP ISPRIME? UNTIL END>>

Gives

950753

You can also get this one with 950774 PREVPRIME

Quote:
2. 5*7^5+5*7^4+2*7^3+4*7^2+2*7+6=552426

Straight forward; I probably should have written a program to make it go a little faster.

Specifically, you can this by hand by loading 96942 on the stack and then executing DUP 7 MOD - 7 / repeatedly. The digits appear after the MOD function, beginning with the least significant digit.
Quote:
6. Derivative has real roots -.707250032311, -4.29559733134, 4.61929258455

f has values -362.723, 104704.599751, 232366.502395

can be confirmed with graphing

232366.5023

You can also get the answer to this one directly with TABVAR

Quote:
8. <<1 1 14 FOR X 3 X ^ INV 1 + X 1 + ^ * NEXT>>

I think this is the most interesting problem on the test because it stresses the precision of the calculator in approximate mode, especially when you consider the last factor is (1+1/3^14)^15

Running Crawl's program in exact mode and then executing ->NUM gives 3.12155183809. Running it in approximate mode gives the same value.

What if we do it with logarithms? First I rewrote the expression as
(4/3)^2 *

(10/9)^3 *

... *

(3^(n-1)+1) n

(---------)

(3^(n-1)^n)

... *

((3^14+1)/3^14))^15

Taking the logarithm you get
2(ln(4)-ln(3)) +

3(ln(10)-2ln(3)) +

...

n(ln(3^(n-1)+1) - (n-1)ln(3)) +

15ln(3^14-1) - 14ln(3))

Evaluating this expression gives 1.138833025985 and takeing e^x gives the final answer of 3.12155183085

Quote:
9.
Use DROITE, the line is Y = 1/3(x-7)+4

take the atan

You can also do this without DROITE. The slope of a line through two points is deltay/deltax, so the slope of the first line is 1/3. From there you can see that acute angle of the perpendicular with Y axis is the same as the angle of the original line with the X axis.
Quote:
14.

<< 1 0 0 -> X S J
<< 2 47 FOR J
J ISPRIME?
IF THEN X 1 + 'X' STO X 2 / DUP FLOOR ==
IF THEN X 1 + DUP 2 ^ + 2 / J * S + 'S' STO
END
END
NEXT
S
>>
>>

Sometimes I can be very dense. I don't see the pattern in the numbers here so I had no hope of solving the problem. Can someone please explain the pattern to me?
Quote:
18. We could do this with a financial function trivially if not for the alternating deposits. There are 126 6-month periods in 21 years.

<< 0 1 126 FOR X 1 .04 12 / + * 600 + 1 .04 12 / + * 900 + NEXT >>

I thought I was clever when I solved this as two financial calculations with payment and interest every 2 months at a rate of 4.006666662, one with a \$600 payment and the other with a \$900 payment, but the \$900 dollar account doesn't run for 126 periods, it only runs 125.5. Ooops...
Quote:
19.

This is much easier than it first seems.

Very nice catch. You can use NEXTPRIME to tighten up the code a little, but your insight is what makes the problem easy.

20. What the heck?!?! This looks downright impossible to me. The men choose 13 of the 25 primes. The women choose 18 of the 74 composites. The 32nd woman chooses a number larger than the largest composite chosen so far and the sum of ALL the numbers is a multiple of 103....

My guess is that the probability is zero because you can't get a multiple of 103, but I don't know why

The pattern of the numbers for #14 is every other prime.

For number 20, I ran a monte carlo simulation, and the answer must be close to 0.6.

What I did there was run 100 trials, then counted how often the critera could be met (it could fail in different ways -- if the number needed to reach the next 103 multiple was a prime, if the number needed was smaller than another composite, if the number needed was greater than 100, etc.). Then I did that a few thousand times and made a histogram.

But I haven't solved it exactly.

To give an example of how this could be possible, assume the men just chose the first 13 primes in order, from 2 to 41. Those sum to 238. Then assume the 18 women chose the first 18 composites in order, from 4 to 28. Those sum to 305. The total sum is 543. The next multiple of 103 is 618. 618-543=75. 75 is a composite number, within the range, and is larger than any other chosen composite. So in this case, it was possible.

Now imagine that the first 12 men chose the first 12 primes in order, 2-37. But the 13th man chose 43 instead of 41. And the 18 women chose the same composites as last time. Then the sum will be 545. And 618-545=73, which is prime, so it's not possible in this case.

But you can't check all possible combinations like this exhaustively. There are C(25,13)*C(74,18)=3.77x10^23 of them.

There's an evil twist to problem 19, which is probably intentional:

Quote:
19. Give the number of positive integers that are no larger than 1,100 and are not divisible by any of the first 25 prime numbers.

The number 1 is positive, less than 1,100 and not divisible by any of the first 25 primes, so it counts too. Therefore the correct answer is 160, not 159.