PDA

View Full Version : I need someone good at maths!



lRhyss
05-02-2014, 02:33 PM
Okay so, I need some values that will for the following problem:

A, B and C are all sides of a triangle

if A, B & C are greater then 0 then they are all invalid sides for a triangle

if A = B + C or B = C + A or C = A + B then the shape is not a triangle

NOW another variable comes in; D which is always equal to 0

so D = 0

and if A is equal to B; D = D + 1
and if B is equal to C; D = D + 1
and if C is equal to A; D = D + 1

and at the end of that, if D is still equal to 0 then the triangle is Scalene
and at the end of that, if D is equal to 1 then the triangle is Isosceles
and at the end of that, if D is equal to something that is not 1 or 0 the triangle is equilateral


I need to come up with at least 4 solutions for all 3 before tomorrow and I just can't do it, I've spent like 4 days trying :(

Any help/solutions will be greatly appreciated :)

Thread moved by Nick (Forum Super Moderator): From 'Discuss Anything' as i feel it is more suited here.

Zak
05-02-2014, 02:48 PM
Kardan; is king of math.

-:Undertaker:-
05-02-2014, 02:49 PM
Kardan (how do I tag him? :P) is good at Maths, if I recall correctly he's doing a Maths degree. Worth asking him.

I can't even do basic maths.

Kardan
05-02-2014, 02:52 PM
I'm on it :)

lRhyss
05-02-2014, 02:54 PM
I'm on it :)

I will legit pay you money if you do this for me

And be your butler for anything and everything <3

Thanks so much for helping!!!!!! :D

Kardan
05-02-2014, 02:57 PM
Ok, what level Maths are you doing? This seems fairly basic, so I've got a basic answer for you.

Also, check this line is correct "if A, B & C are greater then 0 then they are all invalid sides for a triangle" - I would expect it to say less than 0, rather than greater than.

Anyways, from what I've read, do you just need to find numbers for A, B and C that give you equilateral/scalene/isosceles triangles? If so, it's straight forward :)

lRhyss
05-02-2014, 03:11 PM
Ok, what level Maths are you doing? This seems fairly basic, so I've got a basic answer for you.

Also, check this line is correct "if A, B & C are greater then 0 then they are all invalid sides for a triangle" - I would expect it to say less than 0, rather than greater than.

Anyways, from what I've read, do you just need to find numbers for A, B and C that give you equilateral/scalene/isosceles triangles? If so, it's straight forward :)

I think I misread that yeah, But I'm not doing a maths degree that's the thing, It's computer science :P IU knowit involves maths, but I really cannot do algebra D:

Kardan
05-02-2014, 03:15 PM
Ok, it's fairly basic anyway.

Assuming you want them to be greater than 0.

We can select A = B = C = 1.

A, B, C are all greater than 0, so are all valid.
A =/= B + C, likewise for B and C, so shape is a triangle.
Set D = 0.
Now A = B, so D = 0 + 1 = 1.
Now B = C, so D = 1 + 1 = 2.
Now C = A, so D = 2 + 1 = 3.

Now D =/= 0 or 1, so D is equilateral.

Is this what you need? Or do you need it in terms of x?

lRhyss
05-02-2014, 03:19 PM
Ok, it's fairly basic anyway.

Assuming you want them to be greater than 0.

We can select A = B = C = 1.

A, B, C are all greater than 0, so are all valid.
A =/= B + C, likewise for B and C, so shape is a triangle.
Set D = 0.
Now A = B, so D = 0 + 1 = 1.
Now B = C, so D = 1 + 1 = 2.
Now C = A, so D = 2 + 1 = 3.

Now D =/= 0 or 1, so D is equilateral.

Is this what you need? Or do you need it in terms of x?

basically I need 3 sets of 3 different numbers for each triangle, so 3 sets of different numbers that will end up being isos, 3 sets if 3 different numbers that will end up being equilateral and 3 sets of 3 numbers that will end up being scalene... If that makes sense D; sorry to be awkward and having a lack of knowledge in the subject, but it seems what is simple for you, is tricky for me :P

on phone xox

Kardan
05-02-2014, 03:29 PM
basically I need 3 sets of 3 different numbers for each triangle, so 3 sets of different numbers that will end up being isos, 3 sets if 3 different numbers that will end up being equilateral and 3 sets of 3 numbers that will end up being scalene... If that makes sense D; sorry to be awkward and having a lack of knowledge in the subject, but it seems what is simple for you, is tricky for me :P

on phone xox

Well, once you have found a set, you can find another set by multiplying all numbers in that set by the same number.

So if A = 1, B = 1, C = 1 is equilateral, that means A = 2, B = 2, C = 2 is also equilateral.

For Isosceles you will have two sides the same and one different, so A = 2, B = 2, C = 1.

For Scalene, all three will be different, but you need to make sure you can't add two of them to get the third. So A = 4, B = 2, C = 1.

Can you figure out 1 more solution for equilateral and 2 more solutions for Isosceles and Scalene now?

lRhyss
05-02-2014, 03:35 PM
Well, once you have found a set, you can find another set by multiplying all numbers in that set by the same number.

So if A = 1, B = 1, C = 1 is equilateral, that means A = 2, B = 2, C = 2 is also equilateral.

For Isosceles you will have two sides the same and one different, so A = 2, B = 2, C = 1.

For Scalene, all three will be different, but you need to make sure you can't add two of them to get the third. So A = 4, B = 2, C = 1.

Can you figure out 1 more solution for equilateral and 2 more solutions for Isosceles and Scalene now?

thank you so much, that's helped massively :) also; once I have the values I need to create a truth table, how would I go about that? :)

Kardan
05-02-2014, 03:37 PM
thank you so much, that's helped massively :) also; once I have the values I need to create a truth table, how would I go about that? :)

Have you done an example of a truth table in class already? Can't really help you with a truth table if I don't know what you need to show :P

lRhyss
05-02-2014, 03:43 PM
Have you done an example of a truth table in class already? Can't really help you with a truth table if I don't know what you need to show :P

ive done them but I'm not 100% confident on them, like, would I make 3 trust tables for the different triangles, it make one big one for them all? :P

EDIT:

You will need to make the following:

The set of truth tables arising out of your analysis of the code;
A completed Test Plan

Kardan
05-02-2014, 03:50 PM
ive done them but I'm not 100% confident on them, like, would I make 3 trust tables for the different triangles, it make one big one for them all? :P

Without seeing it, I wouldn't be able to tell you really... I'm not entirely sure what conditions you are checking.

lRhyss
06-02-2014, 09:24 AM
Without seeing it, I wouldn't be able to tell you really... I'm not entirely sure what conditions you are checking.

Thanks for all your help :)! I ended up having to do tests and truth tables for each stage, so my completed question is like 4 pages long :P

+rep :)

Want to hide these adverts? Register an account for free!