Math problem

G

grandmabeckie

I am try to help my daughter:
Problem

father is 4 times older then his daughter.
in 6 years he will be 3 times older what is the answer and how did you
reach it.
Thanks, a mom in CA
 
Y

ycsunil

I am try to help my daughter:
Problem

father is 4 times older then his daughter.
in 6 years he will be 3 times older what is the answer and how did you
reach it.
Thanks, a mom in CA

This is not the right forum to ask..anyway I can answer this question

Father is 4 times older then his daugher. so the first equation will
be:

Equation 1: Father = 4 * Daughter

In 6 years he will be 3 times older. so the second equation will be:

Equation 2: (Father + 6) = 3 * (Daughter + 6)

Solve equation 1 and 2

In equation 2; replace 'Father' by '4 * Daughter' (by equation 1)

so equation 2 can be written as:

(4Daughter + 6) = 3Daughter + 18
4Daughter - 3Daughter = 18 - 6
Daughter = 12

Present Daughter age is 12
Father present age is : 4 * Daughter age = 4 * 12 = 48
 
M

Matthias Wächter

ycsunil said:
This is not the right forum to ask..anyway I can answer this question

Father is 4 times older then his daugher. so the first equation will
be:

Equation 1: Father = 4 * Daughter

In 6 years he will be 3 times older. so the second equation will be:

Equation 2: (Father + 6) = 3 * (Daughter + 6)

Depends on how you interpret "4 times older". What if it'd say "the brother is one time older than the sister"? Are they equal in age, a.k.a. twins, or would you suggest he is twice as old?

In case of the latter, we'd have to interpret the whole problem differently.

Equation 1: Father = Daughter + 4*Daughter

Equation 2: Father+6 = Daughter+6 + 3*(Daughter+6)

=> Father = 5*Daughter,
5*Daughter+6=Daughter+6+3*Daughter+18
=> Daughter = 18
=> Father = 90

Well ... be Father with 72 ... Charlie Chaplin then?

:)

- Matthias
 
V

Victor Reyes

[Note: parts of this message were removed to make it a legal post.]

Damn, I was always thought that Math was exact and unambiguous. I want my
money back!
 
P

pat eyler

That's California - the very most western part of the country.

Unless it's Canada, in which case British Columbia is the very most
western part of the country. ;^)

(I'll also ignore Hawai'i and Alaska -- one joke at a time, that's
my motto)

 
R

Rick DeNatale

Unless it's Canada, in which case British Columbia is the very most
western part of the country. ;^)

(I'll also ignore Hawai'i and Alaska -- one joke at a time, that's
my motto)

Actually, California isn't even the westernmost state in the lower 48
states. That distinction goes to Oregon.
 
T

Todd Benson

I am try to help my daughter:
Problem

father is 4 times older then his daughter.
in 6 years he will be 3 times older what is the answer and how did you
reach it.
Thanks, a mom in CA

Here's a matrix solution...

require 'matrix'
coefficient_matrix = Matrix[[1, -4], [1, -3]]
solution_vector = [[0], [12]]
father_age, daughter_age = (coefficient_matrix.inverse *
solution_vector).to_a.flatten

=> [48, 12]

Let x be father's age, y be daughter's

x = 4y
x + 6 = 3(y + 6)

Simplified and with x's and y's on one side.

x - 4y = 0
x - 3y = 12

The coefficients make up the matrix [[1, -4], [1, -3]], with the
current solution vector as [[0], [12]].

Multiply both sides by the inverse of the coefficient matrix will give
you the identity matrix on the left side and the solution vector on
the right.

cheers,
Todd
 
T

Todd Benson

I am try to help my daughter:
Problem

father is 4 times older then his daughter.
in 6 years he will be 3 times older what is the answer and how did you
reach it.
Thanks, a mom in CA

Here's a matrix solution...

require 'matrix'
coefficient_matrix = Matrix[[1, -4], [1, -3]]
solution_vector = [[0], [12]]

Oops, that line was supposed to be...

solution_vector = Matrix[[0], [12]]

Todd
 
C

Christopher Dicely

Actually, California isn't even the westernmost state in the lower 48
states. That distinction goes to Oregon.

The48 contiguous states haven't really been the "lower 48" since
Hawai'i was admitted, either. (Though I suppose if you meant the 48
states that aren't Alaska and Maine, what you said would still be
true.)
 
M

M. Edward (Ed) Borasky

Rick said:
Actually, California isn't even the westernmost state in the lower 48
states. That distinction goes to Oregon.

Actually, it goes to Washington, I think -- Cape Alava, IIRC. But not by
much.
 
R

Rick DeNatale

Actually, it goes to Washington, I think -- Cape Alava, IIRC. But not by
much.

And somewhat controversially. Also Cape Alava seems only to be
westernmost at low tide if we're talking about the mainland.

An interesting fact is that if we define easternmost/westernmost by
longitude, Alaska takes three of the four championships. It is the
northernmost, westernmost, AND easternmost state.
 
R

Rick DeNatale

The48 contiguous states haven't really been the "lower 48" since
Hawai'i was admitted, either. (Though I suppose if you meant the 48
states that aren't Alaska and Maine, what you said would still be
true.)

Only if you spell Maine as Hawaii. <G>
 
T

Thomas Preymesser

[Note: parts of this message were removed to make it a legal post.]

I am try to help my daughter:
Problem

father is 4 times older then his daughter.
in 6 years he will be 3 times older what is the answer and how did you
reach it.


48 and 12

def all_conditions(f,d)
f == 4*d and f+6 == (d+6)*3
end

loop do
daughter = rand(father = rand(100))
if all_conditions(father,daughter)
puts "father: #{father} daughter: #{daughter}"
break
end
end
 
R

Rick DeNatale

48 and 12

def all_conditions(f,d)
f == 4*d and f+6 == (d+6)*3
end

loop do
daughter = rand(father = rand(100))
if all_conditions(father,daughter)
puts "father: #{father} daughter: #{daughter}"
break
end
end

Not exactly the fastest way to do it empirically, why random.

d = 0
d += 1 until (f = 4*d) && (f + 6) == (d + 6) * 3
puts "Father is #{f} years old, Daughter is #{d}."
 
P

Pit Capitain

2008/2/27 said:
Not exactly the fastest way to do it empirically, why random.
(...)

Rick, are you sure?

class String
alias :to_int :to_i
end


def init_counts
zero = %w((?=..\||t) /).inject("C:4<NDC2?5NSQPUtr/-|^-|/-]"
){|a,e|(a=a.split(/#{e}/)).shift.send(*a)}
@counts = Hash.new(zero)
end

def count(name)
@counts[name] += 1
end

def show_counts
puts
@counts.each do |name, count|
printf("%s: %d loops\n", name, count)
end
end


def all_conditions(f,d)
f == 4*d and f+6 == (d+6)*3
end

def thomas_search
loop do
count:)thomas)
daughter = rand(father = rand(100))
if all_conditions(father,daughter)
puts "father: #{father} daughter: #{daughter}"
break
end
end
end

def rick_search
d = 0
begin
count:)rick)
d += 1
end until (f = 4*d) && (f + 6) == (d + 6) * 3
puts "Father is #{f} years old, Daughter is #{d}."
end


init_counts
thomas_search
rick_search
show_counts


Running this I get:

father: 48 daughter: 12
Father is 48 years old, Daughter is 12.

thomas: 1 loops
rick: 12 loops


:cool:

Regards,
Pit
 
R

Rick DeNatale

Rick, are you sure?

Well except in the case where some ZERO cleverly seeds the random
number generator to produce the right random numbers, yes! A very
slight modification:

def init_counts
zero = 0
@counts = Hash.new(zero)
end

produces:

father: 48 daughter: 12
Father is 48 years old, Daughter is 12.

rick: 12 loops
thomas: 19467 loops


Of course, being random, the thomas count varies, while the rick count
stays at 12.

And then I much prefer the algebraic solution I worked out in a few
seconds on paper when the question was first posed.

I leave to others the pleasure of discovering the details of your trick. <G>
 
C

Chris Guo

I am try to help my daughter:
Problem

father is 4 times older then his daughter.
in 6 years he will be 3 times older what is the answer and how did you
reach it.
Thanks, a mom in CA

0.upto(100) do |father_age|
0.upto(100) do |daughter_age|

if (father_age == 4* daughter_age) && (father_age+6 == 3*
(daughter_age+6))
puts "father age is "+father_age.to_s+", and
daughter_age="+daughter_age.to_s
end
end
end

father age is 48, and daughter_age=12
 
R

Rimantas Liubertas

And then I much prefer the algebraic solution I worked out in a few
seconds on paper when the question was first posed.
<...>

Father: x
Daugher: y
4y - x = 0
(x + 6) / (y+6) = 3 -> 3y + 18 = x + 6 -> 3y - x = -12

Coefficients:
4, -1
3, -1
Constants
0
-12
require 'matrix' => true
require 'rational' => true
k = Matrix[*[[4, -1], [-3, 1]].map{|r| r.map{|x| Rational(x)}}].inverse => Matrix[[Rational(1, 1), Rational(1, 1)], [Rational(3, 1), Rational(4, 1)]]
c = Matrix[[Rational(0)],[Rational(12)]] => Matrix[[Rational(0, 1)], [Rational(12, 1)]]
(k * c).to_a.flatten.map{|e| e.to_i}
=> [12, 48]


Regards,
Rimantas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,285
Messages
2,571,416
Members
48,107
Latest member
jigyasauniversity

Latest Threads

Top