Ask your own question, for FREE!
Mathematics 18 Online
ganeshie8 (ganeshie8):

Q4 and Q5 my answer is NOTA for both, looking for a better justification http://assets.openstudy.com/updates/attachments/55ac929ee4b0d48ca8ed17ac-imqwerty-1437374350288-5.jpg

ganeshie8 (ganeshie8):

#4 let \(i\) be the number of operations required excluding swaps, then : \[(15-3i) + (12+2i) = 10\] solving this gives me \(i=17\) so a minimum of \(17\) operations is required to get a sum of \(10\). since all the options are less than \(17\), i ticked last option.

OpenStudy (dan815):

actually the min is even more than 17 :), u can only exchange a total of 5 times before u exhaust all red :

ganeshie8 (ganeshie8):

exactly, i was being pessimistic actually it seems there is no way to get a state where \(red = yellow\) but the proof seems hard

OpenStudy (dan815):

really

ganeshie8 (ganeshie8):

yes i checked for all the sequences upto a length of 50 operations (2^50 sequences)

OpenStudy (dan815):

how did u check so many

OpenStudy (dan815):

thats not too big for the computer ?

ganeshie8 (ganeshie8):

each move consists of choosing between two operations : 1) swap 2) give away 3 red, get 2 yellow for any sequence of length n, there are exactly 2^n possibilities

OpenStudy (dan815):

not quite i think since there is that one restrition where if u dont have enough red u cannot give away anymore

OpenStudy (dan815):

its slightly varying problem, the second u exchange u have stepped into a lower domain of numbers

ganeshie8 (ganeshie8):

when the red becomes negative, just break the loop

OpenStudy (dan815):

when u are on 27 u can use swap to acheive all combinations, then when u are on 26, use swap

ganeshie8 (ganeshie8):

here is the script https://jsfiddle.net/0keuvouv/

OpenStudy (dan815):

what does push method do

ganeshie8 (ganeshie8):

push adds an element to the array

ganeshie8 (ganeshie8):

//declare the array subset ``` subset = [ ]; ``` //add "2, 3" to the array ``` subset.push(2); subset.push(3); ```

ganeshie8 (ganeshie8):

after above commands, subset[0] contains 2 and subset[1] contains 3

OpenStudy (dan815):

for some reason i find it confusing still, can i ask u a simpler question

OpenStudy (dan815):

lets say we start with 5 Red and 4 Yellow

ganeshie8 (ganeshie8):

this spits out all the sequences https://jsfiddle.net/0keuvouv/1/

OpenStudy (dan815):

was is the exchange option double way

OpenStudy (dan815):

like u can exchange 2 yellow for 3 red and vice versa

ganeshie8 (ganeshie8):

if we start with 5 red and 5 yellow, then we can give away 2 yellow, get 3 yellow and see if we ever arrive at 15 red and 12 yellow

ganeshie8 (ganeshie8):

idk programming wise it looks easy but math wise it looks ahrd

ganeshie8 (ganeshie8):

*hard

OpenStudy (dan815):

okay so we can exhcange both ways?

OpenStudy (dan815):

Red to Yellow and Yellow to Red right

ganeshie8 (ganeshie8):

nope, i think the problem changes based on the assumtion

OpenStudy (dan815):

i think its red to yellow only

OpenStudy (dan815):

if u can go other way its infinite

ganeshie8 (ganeshie8):

yeah i got u

OpenStudy (dan815):

is it wrong to think this way okay wait

OpenStudy (dan815):

lets say I start at 5 - Red 4 Yellow i currently have 9 flowers i can have 0 red to 9 red a total of 9 options i will swap in a way that i end up with 3 red and 6 yellow in the end so i can go to 8 flow option with no problem therefore the total nubmer of combinations must be 10 swaps 1 exchange 9 swaps 1 exchange 8 1 7 . .

OpenStudy (dan815):

oh i see the problem is that we cannot get to all the combinaions with that many swaps

OpenStudy (dan815):

wait i got an idea its not that many too i think

OpenStudy (dan815):

|dw:1437489711171:dw|

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!