Questions tagged [physics]

For challenges pertaining to problems in the field of Physics.

32 questions
Filter by
Sorted by
Tagged with
1k 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 ...
3k views

Parallel resistance in electric circuits

Introduction: Two resistors, R1 and R2, in parallel (denoted R1 || R2) have a combined ...
4k views

Billiard balls collision

Given the 2-dimensional positions and velocities of a pair of billiard balls right before impact, calculate their velocities after a perfectly elastic collision. The balls are assumed to be ideal ...
5k 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 ...
2k 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: \begin{align}s = \frac{v+u}{1+vu/c^2}.\end{align} <...
4k views

Draw the arc of a ball

Draw the parabolic trajectory of a thrown ball. The input is the ball's initial upward velocity, a positive integer v. Every second, the ball moves ...
360 views

Help Notwen simulate gravity!

Notwen wants to study the kinematics of bodies thrown from big heights in a uniform gravitational field but unfortunately he doesn't have the technical possibility to go to sufficiently high places ...
941 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 ...
4k views

What do I need to destroy the world?

The gravitational binding energy of a planet is the amount of energy required to separate every tiny piece of it so that no piece will orbit or collide with another piece. For a uniform sphere, ...
469 views

Einstein's Sorter

Challenge Given a list of integers and a velocity, $v$, implement a sorting algorithm which simulates a program sorting the list from smallest to biggest at the given velocity. Einstein's Theory ...
5k views

Lever Simulator 2015

Why a Simulator? Kids these days don't have the time nor the ambition to actually go and stack boxes on the see-saw or play around with balancing physical objects. This leaves lots of room in the ...
3k views

Will I tip over?

Overview Given a 3 line string, figure out if the structure falls to the left, balances, or falls to the right. Input structure You can imagine the structure as metal rod with stuff on top, all ...
2k views

Can this list be balanced?

To check whether a list of non-negative integers is balanced, one can imagine putting respective weights on a board and then try to balance the board on a pivot such that the summarized relative ...
1k views

The Double Slit Experiment

A lazy physicist has the job to perform the double slit experiment. However, they are lazy and can't be bothered to set up all the equipment themselves and so are going to simulate the effects. They ...
253 views

Construct a multiparticle quantum state

Sandboxed and made less complicated and hopefully more fun. Summary of the challenge Given a number of particles, either identical bosons or identical fermions, output the total wave function of the ...
541 views

Calculate gravity on a 1D field

Given a string or list, calculate the effects of gravity on that string/list. The string will be made of 5 characters: N has a weight of 2 ...
643 views

Challenge Given a quark composition of a particle as input, output the corresponding hadron's name. Quarks will be represented by a capital letter and antiquarks by a lowercase letter. The quarks ...
494 views

Derive the Units

Challenge Given a list of SI base units, a list of equations and a target, you must derive the units of the target using only the base units. Derived Units From Wikipedia: The International ...
395 views

Predict the Bomb's Landing Point!

Introduction It was just a normal day, here at your military base. Suddenly, you looked up to see a bomb falling down from the sky! You need to create a program to predict where it will fall, and ...
596 views

Add weight to one side of a see-saw to balance it

Balancing Act A see-saw (supposedly from the French 'ci-ça', meaning 'this-that') forms a third of the holy trinity of playground equipment, along with the similarly ubiquitous slide and swing. A see-...
541 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 ...
2k views

Falling ASCII balls

Input You are given a 2D map with balls and ground in it. It looks like this: 1 5 2 3 4 __________________________ ...
880 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 ...
248 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 ...
695 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 ...
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 ...
493 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 challenge ...
501 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). ...
908 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 ...
367 views

Bob the Bowman!

Bob the Bowman ...