Questions tagged [physics]
For challenges pertaining to problems in the field of Physics.
39 questions
106
votes
16
answers
6k
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 ...
46
votes
19
answers
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 ...
40
votes
13
answers
5k
views
Recreate Minecraft's lighting
Minecraft has a fairly unique lighting system. Each block's light value is either one less than the brightest one surrounding it, or it is a light source itself. Your task is to write a method that ...
39
votes
16
answers
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 being ...
37
votes
35
answers
5k
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 ...
36
votes
2
answers
662
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 ...
32
votes
9
answers
4k
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 ...
32
votes
4
answers
3k
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
...
29
votes
8
answers
6k
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 ...
24
votes
22
answers
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 ...
22
votes
48
answers
4k
views
Parallel resistance in electric circuits
Introduction:
Two resistors, R1 and R2, in parallel (denoted R1 || R2) have a combined ...
22
votes
14
answers
3k
views
Elastic collisions between blocks
The 3Blue1Brown Youtube channel released a video a year ago called "Why do colliding blocks compute pi?" which describes a model where a block A of mass \$a\$ ...
22
votes
3
answers
890
views
Name the Hadrons
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 ...
21
votes
7
answers
774
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 ...
20
votes
13
answers
2k
views
Convert Planck unit to SI metric
Objective
Given a dimension of an SI unit, convert the Lorentz-Heaviside version of a Planck unit \$1\$ into SI metric.
What is a Planck unit?
Planck units are a set of units of measurement. It ...