| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13
Comments:
<0> But <0> Like I said <0> We already know how to do it <0> Our brains are doing it when we come up with the combinations <0> All the algorithm would do is do the same thing to come up with every combination, then pick the shortest one <0> Or maybe compute the shortest one first <0> Then give up on any that go longer <1> Well...start with the biggest numbers and work down to 1 <0> Well, let's say the input is 87 <1> Like start with 10, try to come up with multiplications or addition and loop down to one <1> Start with 10, multiply by 8, add 7 <0> Remainders are seriously involved <1> So you could take 10, 10 is smaller than 87, multiple by 9 (too big) <0> Maybe a recursive approach with the remainders <0> Basically, <1> multiply by 8
<1> You have 7 left, add 7 <0> find_an_operation_that_works(number) <0> find_an_operation_that_works(remainder of the last operation) <0> So like you say, 10 * 8 works <0> Remainder is 7, so how do you account for that <0> Same way you came up with 10*8 <0> Only now the outcome is easier <0> That sort of makes sense to me <2> wow, lots of numbers <3> :( <0> And like you said, start with the high possibles first <3> my brain has blocked to think <0> Wouldn't be super efficient, though <0> The 3 7 * one wouldn't be the first choice by a long shot <0> Maybe try the first level first <3> 10 2 * 1 + <3> that's the firt one <0> No, I mean, depth <0> Let's say we look for all the combinations that come in at or under the value, at the first depth only. <0> So, 10 2 * works <0> But isn't sufficient <0> 9 2 * works <0> Same, not sufficient <0> 7 3 * works, and is sufficient, done. <0> That's exactly 4 iterations <0> Pretty slick for a number that probably has upwards of 25 representations <0> And you might even run 10 last, since it's longer <0> 9, 8, 7... 2, 1, 10 <0> Calculate to the first depth only, the combinations <0> Store the combinations that work <0> If one works and is sufficient, in this hypothetical terminology, that's your winner. <0> So 30 would hit at 6 5 * <3> i'm good only at computer graphic s , maths and programming is not <3> :( <0> It would never get to 10 3 * <0> error, you've got to focus on figuring out what your mind is already doing. <0> And, you have to sit down with your instructors and get help on this stuff <0> It's not enough for people like me to give you answers <3> i know <3> and that's true <0> It's fine to know, but you've got to actually do it, too <0> Any idiot can know something <3> :)) <0> It takes a man to saddle up and actually do it <0> I think we have a good start on your algorithm, but I don't think you understand where we're going with it or how we got there <0> So I'm not sure if looking at it any more will help you <0> I mean <0> I'm not sure if my looking at it will help you <0> Let's try this <0> 42 <3> 10 4 * 2 + <0> Great <0> How'd you come up with that <0> :) <0> I mean, if I show a trained monkey "42", he is NOT going to draw "10 4 * 2 +" on a chalkboard <3> the biggest number from 1 to 10 is 10 <0> Okay? <3> multiplied with 4 , and add 2 <0> No no <0> That's just describing your answer. <0> I want to know how you got there.
<0> Say that, instead of 42 <0> I give you this number: <0> N <0> And you come up with a representation R <0> If I then ask you <0> How did you get to R <0> Your answer should be exactly the same as it was for how you got to 10 4 * 2 + <0> Right? <2> 'night <0> The logic you're working through is the same <3> yes ' i think <0> Night, rdragon <0> Some steps may get skipped because they don't apply to some numbers or others <0> And you might not get to other steps <0> But the steps are there <0> And the goal is to sit down and take a piece of paper and play stupid <0> Work out your answer on paper <0> Start with "42" at the top of the piece of paper <0> Under it, what's the very first thing you think up <0> What's the first number <0> 10? <0> Put 10 <0> How do you get to 4? <0> Explain that step to yourself, that's part of your algorithm. <3> incremeting from 1 to 10 .. <0> Why increment? <0> 1's going to get you the worst case representations, by and large <0> 1 1 + 1 + 1 + etc. <0> And we know that 10's not a great choice because it's actually worse than 9, since it takes up two characters instead of 1 <0> 10 3 * is one character longer than 6 5 * <0> So, the real sequence of numbers to consider would be more like: <3> indeed <0> 9, 8, 7... 2, 1, 10 <0> That's a little optimization in there <0> If you start with 10, logically, it seems a little harder to get to your ideal answer right off the bat. <0> So try 42 again <0> With your new sequence in mind in your algorithm <0> What new representation do you immediately come up with as the shortest one? <3> i need to find an recursive procedure for this problem <0> Don't jump like that <0> One thing at a time <0> At least until I'm satisfied that you understand these little discrete things. <0> When I said 42 <0> You came up with 10 4 * 2 + <0> Because you started with 10, by your own admission <0> I talked a little about how it would make more sense to check 10 last, instead of first <0> You sort of nodded and agreed <0> But now try to demonstrate that you understood <0> When I say 42 now <0> What's the first representation you come up with <3> 42 <3> think .. think <3> 1 min <3> paper and pencil <3> 8 5 * 2 + <0> Why not 9 4 * 8 + ? <0> I want a serious answer to that, don't just nod and say yeah that would work too <0> Why did you come up with 8 5 before 9 4? <0> Your mind had a reason, even if you don't think it did <3> i start from 1 this time <0> Okay <0> Wouldn't 1 give you 1 1 + 1 + 1 + etc.? <0> And the lower numbers in general would all **** in the same way <3> yes it can give but i's not the shortest one <3> adding 1 by one <3> but surley doesent work that way <3> so <0> So then how about 7 7 * 1 +? <3> is biiger the 42 from the start <0> Actually, 6 * 8 would be the shortest, but let's ignore that. <0> Er, sorry <0> 6 6 * 5 + <4> Hey, do double's store in base-10 scientific notation, or base-2 scientific notation? <0> In other words, there are a whole lot of numbers you can use
Return to
#c++ or Go to some related
logs:
#AllNiteCafe cats sugar poisin south africa has mines deeper than any other country in the world, at depths of #c++ tarrast apache 2.2.0 error 403 install grannyfuckers #london boooobs #php
|
|