MedVision ad

Official BOS Trial 2014 Thread (3 Viewers)

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
spoiler alert m9; I am trying to code it :(
Easy coding spoiler:

Tbh coding it is not too hard.

Set a 6 digit array, make a loop, make a value counter so that the counter adds up the contents of each array and the previous answer stored and now store this new value and keep the loop going until you get to the guard of the increments of the loop (That is, 10^6)
 

RealiseNothing

what is that?It is Cowpea
Joined
Jul 10, 2011
Messages
4,591
Location
Sydney
Gender
Male
HSC
2013
Interpret 'all the numbers from 1 to 1 000 000' as every combination of digits in the 6 digit places

Each digit, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 can occupy it

Pick a random spot for these digits, it is found that if we fix a digit, say

1 xxx x2x

Where the x's are variable, there are 10^5 combinations for this, so the sum of all 2's in this column is 10^5 * 2

This is the same for every other digit, so you get 10^5(1+2+...+9)

The column is arbitrary, so 10^5(1+2+...+9)*6

And then add 1 at the end, getting 2700001

Is this more elegant?
Fairly close to my method.

Consider every number as a 6 digit number (i.e. 647 is 000647).

There are 1,000,000 6 digit numbers now = 6,000,000 digits altogether.

The average of the digits is 4.5, so answer is just

You add the 1 to make up for the 1,000,000 which is the only number with greater than 6 digits.
 

RealiseNothing

what is that?It is Cowpea
Joined
Jul 10, 2011
Messages
4,591
Location
Sydney
Gender
Male
HSC
2013
Fairly close to my method.

Consider every number as a 6 digit number (i.e. 647 is 000647).

There are 1,000,000 6 digit numbers now = 6,000,000 digits altogether.

The average of the digits is 4.5, so answer is just

You add the 1 to make up for the 1,000,000 which is the only number with greater than 6 digits.
In general, (number of digits) x (average of possible digits).
 

seventhroot

gg no re
Joined
Aug 3, 2014
Messages
2,803
Gender
Male
HSC
2013
Easy coding spoiler:

Tbh coding it is not too hard.

Set a 6 digit array, make a loop, make a value counter so that the counter adds up the contents of each array and the previous answer stored and now store this new value and keep the loop going until you get to the guard of the increments of the loop (That is, 10^6)[//COLOR]


actually; what I did was have a loop that generates all the numbers and puts it into an array and sums them up as they go along.
 
Joined
Feb 16, 2014
Messages
2,258
Gender
Male
HSC
2014
Guys you have crossed the limits of ego. Ego has not done and will not do anyone good. And no Carrot, its not a battle at all, I am just curious about this year's questions.
There's no ego, we are simply having fun.

it's friendly competition.


calm your farm.
Exactly!
Hm... A competition and friendly... Never possible. 'Friendly competition' = oxymoron.
Possible mate :D
I was expecting him to say something along the lines of 'Yes, MX2, Mechanics'.

Speed out.
Mechanics is not hard... I don't know why people make it out as being the hardest...
 

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
actually; what I did was have a loop that generates all the numbers and puts it into an array and sums them up as they go along.
That's making your code longer to compile and run because you are using more memory for it before it all gets destroyed.

Now imagine you did this using a set of linked lists or pointers. Imagine the amount of malloc you would need to make and free. It would be too big to do. So its better off taking the values, destroying them and only keeping the one value you need out of every loop, that is the current count.

hsc waters it down too much
inb4JoeWolfe
 

seventhroot

gg no re
Joined
Aug 3, 2014
Messages
2,803
Gender
Male
HSC
2013
That's making your code longer to compile and run because you are using more memory for it before it all gets destroyed.

Now imagine you did this using a set of linked lists or pointers. Imagine the amount of malloc you would need to make and free. It would be too big to do. So its better off taking the values, destroying them and only keeping the one value you need out of every loop, that is the current count.
no I override the array I am not making 1 million arrays lel


inb4JoeWolfe
in the tutorial he spent like 10 minutes explaining why it is bad lel; even the maths course pack disses the HSC

let's not derail it m9
 

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
no I override the array I am not making 1 million arrays lel



in the tutorial he spent like 10 minutes explaining why it is bad lel; even the maths course pack disses the HSC

let's not derail it m9
Yeah if you are overriding the array then you are doing what I was doing lol.

No he never explained it as bad. And no maths course pack just left it out aside.
 

dunjaaa

Active Member
Joined
Oct 10, 2012
Messages
473
Gender
Male
HSC
2014
It'll be interesting to see the faces of each one of you. I don't think anyone besides istudent and QZP will recognise who I am tomorrow hehe
 

enigma_1

~~~~ Miss Cricket ~~~~
Joined
Feb 27, 2013
Messages
4,281
Location
Lords
Gender
Female
HSC
2014
Are any girls going? Seems pretty male dominated, or maybe I'm mistaken :/
 

Users Who Are Viewing This Thread (Users: 0, Guests: 3)

Top