Download forward - Storming Robots

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

List of prime numbers wikipedia , lookup

Transcript
Analytical Fun with Math and Robotics – Track 2
FORWARD
What is a robot? Can you think of some examples? Write them here:
Definition
Examples: (NOT Terminator, R2D2, C3PO!!! )
How is Math Involved in Robotics?

Calculating motor power and torque

Gear ratios – speed versus torque

Minimize cost while maximizing performance

Etc.
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 1
Analytical Fun with Math and Robotics – Track 2
DAY 1 – SEGMENT 1: INTEGERS AND DIVISIBILITY
Q1. Define Integers, Real Number and Irrational Real Number. Give an example for each.
DISCUSSION: In what ways do we classify, or group, numbers?
Q2. What is a “perfect square”? Can you list all of the perfect squares less than 100?
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 2
Analytical Fun with Math and Robotics – Track 2
Basic Math Symbols used in this workshop:
Since / Because
% or mod
To get remainer:
e.g.
So / Therefore / Henceforth
!
Negation
E.g.
 10 mod 5 = 0 . Also means 10
is divisible by 5
 10 mod 3 != 0. Also means 10 is
NOT divisible by 3.
 10 mod 3 = 1 . Also means 10
is NOT divisible by 3
Definition
Example
One whole number is divisible by another if, after dividing, the
remainder is zero.
18 is divisible by 9
18 ÷ 9 = 2 with a remainder of 0.
If one whole number is divisible by another number, then the
second number is a factor of the first number.
9 is a factor of 18
18 is divisible by 9 .
A divisibility test is a rule for determining whether one whole
number is divisible by another. It is a quick way to find factors
of large numbers.
1356 is Divisible by 3:
1+3+5+6 = 15. 15 is divisible by 3.
i.e. Pass the divisibility rule of 3.
Modulo: symbol “%”
18 % 9 = 0 , that means 18 is divisible by 9 as remainder is 0.
100 % 4 = 0
120 % 12 = 0
125 % 3 = 5, i.e !=0
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 3
Analytical Fun with Math and Robotics – Track 2
DIVISIBILITY RULES:
Divisible
by:
2
3
If:
The last digit is even (0,2,4,6,8)
The sum of the digits is divisible by 3
Examples:
Yes
128
381
3+8+1=12, and 12%3 = 0
4
The last 2 digits are divisible by 4
5
The last digit is 0 or 5
1312
12%4 = 0
175
6
The number is divisible by both 2 and 3
114
4 is even, and 1+1+4=6 and
6%3=0
7
Double the last digit and
Subtract it from the rest of the number
and
the answer is: 0, or divisible by 7
672
Double 2 = 4, and
67 – 4 = 63, and 63 % 7 = 0
No
129
217
2+1+7=10, but
10%3 != 0
7019
19%4 != 0
809
9 % != 0
208
3+0+8=11, but
11%3 !=0
905
Double 5 is 10,
90–10 = 80, but 80%7 ! = 0
Challenge
Figure out the divisibility of the following numbers. Then, give two examples: one is divisible and another does not. Use
the
8
and % Symbols to explain like the samples used above.
9
10
11
12
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 4
Analytical Fun with Math and Robotics – Track 2
Q4. Give 2 examples for each of the following number to demonstrate its’ divisibility rules. And why? (use
the sample format shown in the table above)
Sample number meets the divisibility rule
Sample number does not meet the divisibility rule
#2#3#4#5#6#7#8#9# 10 # 11 # 12 -
CHALLENGE PROBLEMS
a) What is the largest integer whose cube is less than 10,000?
b) How many integers 1-9 are divisors of the five-digit number 24,516?
c) The diameter of a circle is a whole number. The area of the circle is between 100 and 120 square
units. What is the number of units in the circle’s diameter?
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 5
Analytical Fun with Math and Robotics – Track 2
SEGMENT 2: MECHANICAL GEAR MATH
Foundation required: Fractions, Ratios, and Proportions
Sample 1 - direct proportion:
360 𝑑𝑒𝑔𝑟𝑒𝑒𝑠
15 𝑐𝑚
𝑥=
=
𝑥 𝑑𝑒𝑔𝑟𝑒𝑒𝑠
30 𝑐𝑚
360 𝑑𝑒𝑔𝑟𝑒𝑒𝑠 ∗ 30 𝑐𝑚
15 𝑐𝑚
= 720 degrees
Sample 2 - Unit Ratio:
e.g. Wheel Diameter = 10 cm
Encoder per wheel Revolution = 360 encoder value
Distance per one wheel Revolution =
10 cm *  
i.e. 360 encoder value = 10 cm *  
360 𝑒𝑛𝑐𝑜𝑑𝑒𝑟 𝑣𝑎𝑙𝑢𝑒
10∗ 
= 1 cm
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 6
Analytical Fun with Math and Robotics – Track 2
GEAR RATIOS
Assume 40-t == driver gear
8-t == driven gear
Gear ratio==
Or
8
40
1
5
The gear ratio is the ratio of the number of teeth on each gear. Here is a gear with 8 teeth
meshed with a gear with 40 teeth.
What does this gear ratio tell us?
 he Input/driver g ear will rotate 5X when the output/follower gear rotates 1X.
 The Input/driver gear will rotate 5X faster than the output/follower gear.
 This contraption is meant to increase torque.
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 7
Analytical Fun with Math and Robotics – Track 2
EXERCISES WITH GEAR RATIO
Based on the information provided about the gears shown on this page, do the following.
1. Fill in the gear ratio for the combination
2. Write a statement to describe the number of rotations of the driving gear go around vs the Driven
(or called Follower) gear’s?
Note that the driving gear is always on the right. Possible gear sizes are 40, 24, 14 and 8 tooth gears.
Example 1:
It means :
Example 2:
It means :
24-tooth gear driving an 8-tooth gear . Gear Ratio =
8
24
=
1
3
driver gear turns 1x == Driven gear turns 3x
40-tooth gear driving an 24-tooth gear . Gear Ratio =
24
40
=
3
5
driver gear turns 3x == Driven gear turns 5x
It means: _______________________________________________________________________
It means: ____________________________________________________________________
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 8
Analytical Fun with Math and Robotics – Track 2
It means: ____________________________________________________________________
It means: ____________________________________________________________________
It means: ____________________________________________________________________
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 9
Analytical Fun with Math and Robotics – Track 2
GEAR RATIOS WORD PROBLEMS
Mary and Tim are designing robots with different gear ratios to complete various tasks.
1) Mary and Tim want to design a robot with as high a gear ratio as possible in order to climb the greatest
possible slope. They have 40, 24, 14, 12 and 8 tooth gears available. (show work)
a) What gear should they choose as their Driven gear?
b) What gear should they choose as their driving gear?
c) What would be the gear ratio of this robot?
2) Mary and Tim want to design a robot with as low a gear ratio as possible so that it can reach the
greatest possible speed. They have pulleys with diameters of 5, 7 and 9 centimeters available.
a) What diameter pulley should they choose as their Driven pulley?
b) What diameter pulley should they choose as their driving pulley?
c) What would be the gear ratio of this robot?
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 10
Analytical Fun with Math and Robotics – Track 2
3) Mary and Tim want to design a robot with a gear ratio of 2, using a 16 tooth Driven gear. They have 40,
24, 16, 14 and 8 tooth gears available. What gear should they choose as their driving gear?
4) Mary and Tim want to design a robot with a gear ratio of 3/2, using a 6 cm diameter Driven pulley.
They have pulleys of 3, 4, and 9 cm diameter available. Which should be their driving pulley?
5) Mary and Tim want to design a robot with a gear ratio of 2/3, using a 60 tooth driving gear. They have
10, 20, 40, and 90 tooth gears available. What gear should they choose as their Driven gear?
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 11
Analytical Fun with Math and Robotics – Track 2
ROBOTICS: FLOWCHART/PSUEDO-CODE DESIGN
For all Robotics projects, you need to refer to the online RobotC Packet - http://learn.stormingrobotsc.om –
RobotC Packet I
Today’s topics:
 Simple to Complex Behavior
 Decomposition
 Fundamental Programming concepts - Chapter 1 in the RobotC packet I.
Exercises
1) Complete the Challenge on online packet – http://learn.stormingrobotsc.om – RobotC Packet I.
o For novice – complete the challenge in Chapter 1
o For experience – complete the challenge in Chapter 2 and/or Chapter 8 (using the Buttons).
2) Create your Dancing Robots to dance in synchrony to music. Do note that there is a linear
proportional relationship between:
 Speed and power
 Speed and wheel diameter
 Wheel diameter and distance traveled
 Wheel diameter and Robot turning degrees
 Also depending on gear ratio.
Important: Must perform design work for each dance move and write a flowchart for each move!
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 12
Analytical Fun with Math and Robotics – Track 2
DAY 3 - DISCOVERING PRIME AND COMPOSITE NUMBERS
This is part of introduction to Number Theory. Number Theory is a branch of mathematics
focusing on the positive integers.
The main goal of number theory is to discover interesting and unexpected relationships between different
sorts of numbers and to prove that these relationships are true.
Number theory is especially important in computer science, allowing computers to perform high-speed and
complex calculations.
For a prime number p, find the smallest composite number that has no prime divisors less than p.
If a natural number n which is greater than 1 has no prime divisors less than or equal to the square root of
n, then n is prime.
Highly efficient way to find Primes under N - The Sieve of Eratosthenes. Use the worksheet provided
in class.
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 13
Analytical Fun with Math and Robotics – Track 2
P RIME VS C OMPOSITE – P RIMALITY T EST
You have gone through divisibility rules in day 1. Now, say, you are given a number, how do you know it is a
prime? You need to do a primality test.
A primality test ≠ prime factorization:
A primality test is a test to determine whether or not a given number is prime. Note that this is not the same
as prime factorization which actually decomposes the number into its constituent prime factors.
Two types of primality tests:
Deterministic : Deterministic tests determine with absolute certainty whether a number is prime. Examples
of deterministic tests include the Lucas-Lehmer test and elliptic curve primality proving.
Probabilistic. Probabilistic tests can potentially (although with very small probability) falsely identify a
composite number as prime (although not vice versa). It is general much faster than deterministic tests.
Numbers that have passed a probabilistic prime test are therefore properly referred to as probable primes
until their primality can be demonstrated deterministically.
A number that passes a probabilistic test but is in fact composite is known as a pseudoprime. There are many
specific types of pseudoprimes, the most common being the Fermat pseudoprimes, which are composites
that nonetheless satisfy Fermat's Little theorem.
Fermat's little theorem
 pow(x, Num- 1) % Num != 1 ; i.e. composite.
 pow(x, Num- 1) % Num == 1; Highly probable Prime.
 Where 0< x < n . Usually use x =2, as it is the easiest one to use.
 Then, may use the deterministic Sieve of Eratosthenes Algorithm to guarantee primality.
There is another one called Rabin-Miller strong pseudoprime test (which we do not cover in this workshop).
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 14
Analytical Fun with Math and Robotics – Track 2
CHALLENGE PROBLEMS
i.
What is the largest two digit prime number whose digits are also prime?
ii.
Find the remainder when the sum of the six smallest primes is divided by the seventh.
iii.
Number A is a prime. What is the remainder of A*A + 17 / 12?
iv.
Which of the following is not prime?
a. 1993
b. 20017
c. 2233
d. 493969
e. 442213
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 15
Analytical Fun with Math and Robotics – Track 2
DAY 4 GCF AND LCM
Greatest Common Factor (GCF) and Greatest Common Divisor (GCD) are the same thing!
When the only common positive divisor of a pair of integers is 1, we say that those integers are relatively
prime.
Highly efficient way to obtain GCF - The Division Theorem and the Euclidean Algorithm. Use worksheet
provided in class.
common math divisible symbol ( | ):
e.g. Since 15 = 3 × 5, it is true that 3 ∣ 15 and 5 ∣ 15.
70 = 7 * 10
and 63 = 7 * 9
Thus 7 goes not (70+63) and (70-63) . this can be written as:
Since 7 | 35 and 7 | 49, 7 | (49 + 35) as well as 7 | (49 – 35)
Or you can generalize it as:
If n|a and n|b, then n|(a+b) and n|(a-b).
CHALLENGE PROBLEMS
a) How many positive integers less than 101 are multiples of either 5 or 7, but not both at once?
b) Erin baked 252 cookies, Mia baked 105 cookies, and Gavin baked 168 cookies. Each baker packaged
them with the same number of cookies in each package. What is the greatest number of cookies that
could be in each package?
c) There are 25 primes less than 100. Is their sum even or odd?
3322 Rt. 22 West, Building 15 - #1503, Branchburg, NJ 08876  908-595-1010  www.stormingrobots.com
Page | 16