Sunday, December 13, 2015

Day III (HW)

Homework II after 3rd lecture

These are the questions that correspond to these solutions

1.       Factor the number 322. 
2.       Find the greatest common denominator of 322 and 6. 
3.       Is 322 a prime number? 
4.       How many primes occur between 0 and 322? 
5.       Approximate    pi    as a rational number. 
6.       Find 10! (10 factorial). 
Find the number of possible groups containing 3 people from a group of 20, when order does not matter. (20 choose 3)      

*pi is expressed as a fraction because of the short g function




The top is commented out because it is less complicated than the under part and it does the same thing.
the bottom asks the user to input values. Then the final value is outputted in the bottom.



First two sections are for comparing incandescent and cfl lightbulbs. First the joules the appliances and bulbs use up are calculated and summed. Then this is divided by the amount of heat that the ac unit can remove. This will give us the number of AC units we need . However we needed to use the ceil function because we cant buy fractions of an AC unit. The following portion allows for imputs for the number of bulbs and appliances.


These are the questions
1.       Here are some discrete math questions for you to implement in MATLAB. 
a.       If you have four people, how many different ways can you arrange them in a line? 
b.      How many different robotics teams of 7 members can you form from a class of 28 students? (Combinations—order does not matter). 
c.       Since each player on a robotics team is assigned a particular role, order does matter. Recalculate the possible number of different robotics teams that can be formed when order is taken into account.    
d.      There are 52 different cards in a deck. How many different hands of 5 cards each are possible? Remember, every hand can be arranged 120 (5!) different ways.  What are the chances of getting dealt a royal flush

These questions are basically probability questions. The poker one was the hardest but you still basically had to follow the equations and know when the order matters and when it doesn't. In this case we had to divide by four to account for the four suits, thus ways one can get a flush. This might be wrong since i dont know that much about poker.









No comments:

Post a Comment