The tag has no usage guidance.

learn more… | top users | synonyms

6
votes
21answers
1k views

Calculate the relativistic velocity

In special relativity, the velocity of a moving object relative to another object that is moving in the opposite direction is given by the formula: s = ( v + u ) / ( 1 + ( v * u / ( c ^ 2 ) ) ) ...
26
votes
3answers
410 views

Volts, Amps, Watts and Ohms: given two, calculate the other two

Ohm's law tells us that the current (I) in amps flowing through a resistance (R) in Ohms when a voltage (V) is applied across it is given as follows: V = I / R Similarly the power (P) in watts ...
19
votes
9answers
738 views

How far is the Sun?

Introduction tl;dr Continuously output the current distance from the Earth to the Sun. Simplified, the orbit of the Earth around the Sun is an ellipse. So the actual distance between both is ...
11
votes
1answer
191 views

Attraction Between Words

Newton's theory of gravitation says that the gravitational force between two point masses is F=(Gm1m2)/ r2 Where G is the gravitational constant: 6.674×10−11 N · (m/kg)2 m1 is the mass of the ...
21
votes
7answers
582 views

Electrostatic potential of a simple system

In physics, like electric charges repel, and unlike charges attract. The potential energy between two unit charges separated by a distance d is 1/d for like charges and -1/d for unlike charges. The ...
15
votes
3answers
408 views

Dimensional Analysis

Calculate a product or ratio of SI units. For example, kg m / s s (kilogram-meter per second squared) should return N (newton). The input will always be either: A list of symbols for SI units, ...
17
votes
5answers
1k views

The Interview: The Front Nine

The Interview: The Front Nine This is the first of a series of challenges inspired by programming job interview questions. You walk into the office where your potential future boss sits. "Come on in ...
55
votes
4answers
1k views

Simulate the Universe!

One nice property of a Turing-complete language is that it can be used to write any program, up to and including the simulation of the entire Universe. Your job is to do exactly that: write a program ...
32
votes
2answers
352 views

Will the tower balance?

Introduction Given an ASCII tower and the force of the wind, write a program or function to determine if the tower will balance or which way it will fall. For example the first tower balances but ...
9
votes
1answer
425 views

Variant of racetrack with exact finishing point and zero terminal velocity

Introduction The challenge is a very interesting variant of the game racetrack and those two challenges: To Vectory! – The Vector Racing Grand Prix Program a Racing Car Source of this ...
5
votes
2answers
396 views

3-D Antiferromagnetism

A while ago, we had a challenge related to antiferromagnetism (AF) in two dimensions. Now, on a 2-d square lattice, antiferromagnetic is antiferromagnetic, and that is all there is to it. Moving to ...
13
votes
1answer
312 views

Bob the Bowman!

Bob the Bowman o /( )\ This is Bob. L L Bob wants to be an archer. ############# . / \...
17
votes
5answers
768 views

What's the voltage over each component?

The picture below shows a RLC circuit. A RLC circuit is an electrical circuit consisting of a resistor (R), an inductor (L), and a capacitor (C), connected in series or in parallel. (1) In order to ...
30
votes
9answers
2k views

Balance a set of weights on a seesaw

Balancing Act Overview Given an input of 3 single-digit positive integers representing a set of weights, output an ASCII representation of a seesaw with the weights placed on it so that it is in ...
17
votes
1answer
541 views

Mini Golf Code Golf

This is a mini golf hole: The outer boundary is a circle with radius 10 and center (0,0). The inner boundary is a circle with radius 3 and center (0,5). The tee is at (0,-8). Assume the ball is ...