All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
A clock area (Posted on 2023-08-23) Difficulty: 3 of 5
A clock has an hour, minute, and second hand, all of length 1. Let T be the triangle formed by the ends of these hands. A time of day is chosen uniformly at random. What is the expected value of the area of T?

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
re(3): Computer method - faulty premise | Comment 4 of 6 |
(In reply to re(2): Computer method - faulty premise by Larry)

I reworked the code; I have not debugged so I can't rule out a math error but I wanted to get this out quickly.

This time I get:  0.480962582520713

I checked the position of the 3 hands once per second for 12 hours.  Even though the clock hands start vertical and rotate clockwise, I used the usual custom for cos and sin assuming the hands all start horizontal and rotate counterclockwise.  This should just be a rotated mirror image of the actual clock.

---------
import math
pi = math.pi


def area(a,b,c):
    """ Assume a,b,c are angles in radians, and
    the 3 vertices of a triangle are at (cos a, sin a),
    (cos b, sin b) and (cos c, sin c)  
    return the area   """
    x = [math.cos(a), math.cos(b), math.cos(c),math.cos(a)]
    y = [math.sin(a), math.sin(b), math.sin(c),math.sin(a)]

    d = []
    for i in range(3):
        d.append( ( (x[i+1]-x[i])**2 + (y[i+1]-y[i])**2 )**.5  )
    semip = sum(d)/2
    terms = [ max(semip-d[i],0) for i in range(3)]
    ans = ( (semip-d[0])*(semip-d[1])*(semip-d[2])*semip )**.5
    ans = ( terms[0] * terms[1] * terms[2]  * semip )**.5
    return  ans

count = 0
total = 0

for sec in range(43200):
    second_hand = sec%60 * pi / 30
    minute_hand = (sec/60)%60  * pi / 30
    hour_hand = (sec/3600)%60  * pi / 30
    count += 1
    total += area( second_hand, minute_hand, hour_hand )

print(total/count)

  Posted by Larry on 2023-08-23 13:49:57
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (1)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information