Login

Welcome, Guest. Please login or register.

April 20, 2026, 12:54:27 pm

Author Topic: FIT1029 Algorithms last lecture  (Read 2580 times)  Share 

0 Members and 1 Guest are viewing this topic.

Devva[R]

  • Victorian
  • Trendsetter
  • **
  • Posts: 134
  • ニャァァァァァァー
  • Respect: +8
  • School: West Side Schools
  • School Grad Year: 2011
FIT1029 Algorithms last lecture
« on: March 10, 2012, 07:14:23 pm »
0
Did anyone write down the algorithm that David did for the Age of the Three Kids? I came to the lecture late and missed it and the recording doesn't record him writing it down. Thanks.
2012: Bachelor of Software Engineering(Maths Minor) IBL Stream @ Monash University, Clayton
2014: Internship
2015: Graduate!

robertnyan.com

iamtom

  • Victorian
  • Forum Obsessive
  • ***
  • Posts: 451
  • Indubitably dubious
  • Respect: +35
  • School: Melbourne High School
  • School Grad Year: 2011
Re: FIT1029 Algorithms last lecture
« Reply #1 on: March 10, 2012, 10:37:44 pm »
+1
This is what I wrote down:

AGE OF THE KIDS:
What we know:
-Product of their age is 36
y = youngest
m = middle
o = oldest
YMO = integers
1 < Y < M < O

Let Y, M, O = 1

Repeat
{
   Let O = O + 1
   If Y x M x O = 36
     then print Y, M, O
     if (O = 36)
     then
    {
      M = M + 1
      O = M
     if M = 36
     then
      {
      Y = Y + 1
      M = Y
      O = M
if Y = 36, exit
      }
   }
}

Basically the logic is you write down all the possible products of 36, like so:

O  M Y SUM
36 1 1 38
18 2 1 21
12 3 1 16
9   4 1 14
9   2 2 13
6   6 1 13
6   3 2 11
4   3 3 10

Now, APPARENTLY the logic is that, because he needed more information after being told the "sum of their age is equal to the amount of windows on the building over there", that there must be more than one solution.

We are distinctly told that there is an oldest - not that there's a distinct middle or youngest, IIRC. So the solution must be (9 * 2 * 2).
2013: Wizardry, life.

zhenzhenzhen

  • Victorian
  • Forum Leader
  • ****
  • Posts: 508
  • Not part of the furniture
  • Respect: +20
Re: FIT1029 Algorithms last lecture
« Reply #2 on: March 11, 2012, 01:23:59 am »
0
lol same example from 2 years ago haha. really got me into puzzles
2010 - 2013: Bachelor of Software Engineering - Monash (completed w/ alternative exit to B. Comp Sci)
2014 - 2016: Master of Laws (Juris Doctor) - Monash

Devva[R]

  • Victorian
  • Trendsetter
  • **
  • Posts: 134
  • ニャァァァァァァー
  • Respect: +8
  • School: West Side Schools
  • School Grad Year: 2011
Re: FIT1029 Algorithms last lecture
« Reply #3 on: March 19, 2012, 05:06:26 pm »
0
@tom sorry for the late reply, but thanks! You're a life saver.

@zhen, yeah, I'm really liking this unit. The puzzles are fun.

Btw, I really hate the first question for the assignment. It's so vague, "creating an algorithm so a friend can book accomodation and transport for their holiday". I'm not even sure what to write.
2012: Bachelor of Software Engineering(Maths Minor) IBL Stream @ Monash University, Clayton
2014: Internship
2015: Graduate!

robertnyan.com

zhenzhenzhen

  • Victorian
  • Forum Leader
  • ****
  • Posts: 508
  • Not part of the furniture
  • Respect: +20
Re: FIT1029 Algorithms last lecture
« Reply #4 on: March 20, 2012, 05:07:01 pm »
0
1. turn on computer
2. open web browser
3. access some airline website

...

x. hit submit
xx. print receipt

simple :)
2010 - 2013: Bachelor of Software Engineering - Monash (completed w/ alternative exit to B. Comp Sci)
2014 - 2016: Master of Laws (Juris Doctor) - Monash

Devva[R]

  • Victorian
  • Trendsetter
  • **
  • Posts: 134
  • ニャァァァァァァー
  • Respect: +8
  • School: West Side Schools
  • School Grad Year: 2011
Re: FIT1029 Algorithms last lecture
« Reply #5 on: March 20, 2012, 07:31:41 pm »
0
Heh, I was too paranoid about that being too simplistic, so I did some crazy loops comparing the expectations of the friend to the accommodation and lower it if it was too high.
2012: Bachelor of Software Engineering(Maths Minor) IBL Stream @ Monash University, Clayton
2014: Internship
2015: Graduate!

robertnyan.com

zhenzhenzhen

  • Victorian
  • Forum Leader
  • ****
  • Posts: 508
  • Not part of the furniture
  • Respect: +20
Re: FIT1029 Algorithms last lecture
« Reply #6 on: March 20, 2012, 08:06:32 pm »
0
heh, my method would get full marks in the test - simplicity is king IMO. why put yourself through torture now when you have the real guns - Turing machines and dynamic programming to work through later? :P but as long as a solution yields what the question wants, it should be fine.

in the final exams I had a question : how would you solve some alphanumerical problem like EDWGE + HFHVYFB = HDGGE? it was worth ten marks.

I answered : Try all possible combinations of numbers to fit the letters.

I got full marks. :D
2010 - 2013: Bachelor of Software Engineering - Monash (completed w/ alternative exit to B. Comp Sci)
2014 - 2016: Master of Laws (Juris Doctor) - Monash

Devva[R]

  • Victorian
  • Trendsetter
  • **
  • Posts: 134
  • ニャァァァァァァー
  • Respect: +8
  • School: West Side Schools
  • School Grad Year: 2011
Re: FIT1029 Algorithms last lecture
« Reply #7 on: March 20, 2012, 09:20:26 pm »
0
Wow, that's pretty awesome. I wonder if I could get away with "Use brute force" for all the questions. It should get results...just really really inefficient. =p
« Last Edit: March 20, 2012, 09:22:41 pm by Devva[R] »
2012: Bachelor of Software Engineering(Maths Minor) IBL Stream @ Monash University, Clayton
2014: Internship
2015: Graduate!

robertnyan.com