Milikan's Experiment Lab - Euclidean Algorithm

Click For Summary
SUMMARY

The discussion focuses on applying the Euclidean Algorithm to determine the mass of an individual jellybean from various bags with different total masses. The user outlines their approach of subtracting the mass of the bags from the total mass to isolate the jellybean mass and then using the Euclidean Algorithm to find the greatest common divisor (GCD) of the resulting masses. The challenge arises in knowing when to stop the algorithm, especially when dealing with real numbers. The solution involves iterating through the masses, performing integer division, and repeating the process until all but one mass reaches zero remainder.

PREREQUISITES
  • Understanding of the Euclidean Algorithm for GCD calculation
  • Basic knowledge of mass measurement and subtraction
  • Familiarity with Java programming for implementing recursive algorithms
  • Concept of integer division and its application in algorithmic processes
NEXT STEPS
  • Research the implementation of the Euclidean Algorithm in Java
  • Learn about handling floating-point precision in numerical algorithms
  • Explore optimization techniques for recursive algorithms
  • Study the application of GCD in real-world scenarios, such as mass and charge calculations
USEFUL FOR

Students and educators in physics and mathematics, particularly those involved in experimental design and numerical analysis, as well as programmers looking to enhance their algorithmic skills in Java.

Morass
Messages
7
Reaction score
0

Homework Statement



Hey guys I need help with a lab I'm doing that is similar to the Milikan's experiment. I am given 10 bags each holding the same item (Jellybean) of various quantities. Each bag has a different mass. What I'm trying to figure out is the mass of the individual item, so mass of 1 jellybean. This is similar to finding the elementary charges for milikan's experiment.

Homework Equations


I believe using the euclidean algorithm is the best method because all the bags should be a integer multiple of the mass of 1 jellybean.


The Attempt at a Solution


First i subtracted the mass of the bags from the mass of bag + jellybeans, to find the mass of the jellybeans only. Then i ordered the various masses in increasing order. Now my problem is, in doing Euclidean Algorithm to find GCD, since these numbers are real numbers, how do I know when to stop using the algorithm. I've made a Java program that does the algorithm recursively but I'm not sure when to stop because this algorithm can go on forever. Thanks in advance.
 
Physics news on Phys.org
Do integer division with the smallest mass (m1) (result is Ni for the i-th mass) and replace all masses by the remainder mi-Ni*m1.Choose the smallest again and repeat till you get zero remainder for all but one. The last smallest mass still can include a few beans, but that is the best you can do.

As an example: assume that here are 5 bags of mass 33, 16.83, 15.84, 5.94, 2.31. The smallest is 2.31, integer division gives 14, 7, 6, 2, and the remainders are 0.66, 0.66, 1.98, 1.32, Choose these values for mi and add also 2.31. The smallest is 0.66. Repeat the procedure, the remainders are 0, 0, 0, 0, 0.33. You have one non-zero remainder, that is the mass of one bean (or integer multiple of it).

ehild
 

Similar threads

Replies
4
Views
3K
  • · Replies 13 ·
Replies
13
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K