2
   

Math riddle

 
 
Reply Sat 20 Jan, 2018 08:41 am
A, and C are digits with different integer values (example CA =10, or 78)
y = integer between 1 and 100
B = 1

Which of the three equations can be true?

(CA * y) - 1 = ABC
(CA * y) - 1 = ACB
(CA * y) - 1 = BAC
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 2 • Views: 6,368 • Replies: 14
No top replies

 
centrox
 
  1  
Reply Sun 21 Jan, 2018 08:24 am
All three can be true.

Equation 1: (CA * y) - 1 = ABC
C=1, B=1, A=3, y=24
(13 * 24) - 1 = 311

C=5, B=1, A=6, y=11
(56 * 11) - 1 = 615

C=1, B=1, A=9, y=48
(19 * 48) - 1 = 911

Equation 2: (CA * y) - 1 = ACB
C= 1, A=3, y = 24
(13 * 24) - 1 = 311

C=1, B=1, A=9, y = 48
(19 * 48) - 1 = 911

C=2, B=1, A=3, y = 14
(23 * 14) - 1 = 321

Equation 3: (CA * y) - 1 = BAC
C=7, B=1, A=4, y=2
(74 * 2) - 1 = 147
whimsical
 
  1  
Reply Mon 22 Jan, 2018 06:31 am
@centrox,
Thank you very much Centrox
0 Replies
 
whimsical
 
  1  
Reply Mon 22 Jan, 2018 06:36 am
@centrox,
Can I ask you one more? It's the same but without the -1

A, and C are digits with different integer values (example CA =10, or 78, etc.)
y = integer between 1 and 100
B = 1

Which of the three equations can be true?

(CA * y) = ABC
(CA * y) = ACB
(CA * y) = BAC
0 Replies
 
centrox
 
  1  
Reply Mon 22 Jan, 2018 01:51 pm
These aren't 'riddles' are they? They're your math homework, isn't that right?
Kolyo
 
  1  
Reply Mon 22 Jan, 2018 10:47 pm
@centrox,
centrox wrote:

These aren't 'riddles' are they? They're your math homework, isn't that right?


It's a take home entrance exam. :-)

In no small way, you have helped to shape the future.
0 Replies
 
whimsical
 
  1  
Reply Wed 24 Jan, 2018 02:39 am
@centrox,
Very Happy No Centrox, I make puzzles, but I can't program to show me some possible solutions. Sometimes I get an idea, but to work them out I need to see what solutions there are.
But Thanks anyway. I can do it myself by listing all by hand, and then check with ones works.
ekename
 
  1  
Reply Wed 24 Jan, 2018 06:15 am
@whimsical,
Quote:
I can do it myself by listing all by hand


Quote:
then check with ones works


And in that moment of whimsy a heart was broken.



whimsical
 
  1  
Reply Wed 24 Jan, 2018 09:29 am
@ekename,
https://youtu.be/d-diB65scQU

0 Replies
 
centrox
 
  1  
Reply Wed 24 Jan, 2018 11:33 am
@whimsical,
whimsical wrote:
program to show me some possible solutions.

To solve the one above, I wrote a program in Visual Basic Script, which shows all the solutions I posted. Best to run it in a console window using Cscript.exe so the matches are listed nicely.

' A, and C are digits with different integer values (example CA =10, or 78)
' y = integer between 1 and 100
' B = 1

' Which of the three equations can be true?

' (CA * y) - 1 = ABC
' (CA * y) - 1 = ACB
' (CA * y) - 1 = BAC

for c = 0 to 9
for a = 0 to 9
for y = 1 to 100
nstring = cstr(c) & cstr (a)
lhs = "(" & nstring & " * " & cstr(y) & ") - 1 "
rhs1 = cstr(a) & "1" & cstr (c)
rhs2 = cstr(a) & cstr(c) & "1"
rhs3 = "1" & cstr(a) & cstr(c)
leftcalc = eval(lhs)
r1 = cint(rhs1)
r2 = cint(rhs2)
r3 = cint(rhs3)

if leftcalc = r1 Then
wscript.echo "Equation 1: (CA * y) - 1 = ABC"
wscript.echo "C = " & c & " A = " & a & " y = " & y & "; " & lhs & " = " & eval(lhs)
wscript.echo " "
end if

if leftcalc = r2 Then
wscript.echo "Equation 2: (CA * y) - 1 = ACB"
wscript.echo "C = " & c & " A = " & a & " y = " & y & "; " & lhs & " = " & eval(lhs)
wscript.echo " "
end if

if leftcalc = r3 Then
wscript.echo "Equation 3: (CA * y) - 1 = BAC"
wscript.echo "C = " & c & " A = " & a & " y = " & y & "; " & lhs & " = " & eval(lhs)
wscript.echo " "
end if

Next
Next
Next



0 Replies
 
centrox
 
  1  
Reply Fri 26 Jan, 2018 07:30 am
Better in Python

Code:b = 1
for c in range(0, 10, 1):
for a in range(0, 10, 1):
for y in range(1, 101,1):
vallhs=eval("("+str(int(str(c)+str(a)))+"*"+str(y)+")"+"-1")
if vallhs==int(str(a)+str(b)+str(c)):
print "1 A="+str(c),"B="+str(b),"C="+str(c),"y="+str(y),"ABC="+str(vallhs)
if vallhs==int(str(a)+str(c)+str(b)):
print "2 A="+str(c),"C="+str(c),"B="+str(b),"y="+str(y),"ACB="+str(vallhs)
if vallhs==int(str(b)+str(a)+str(c)):
print "3 B="+str(b),"A="+str(a),"C="+str(c),"y="+str(y),"BAC="+str(vallhs)


Result:

Code:1 A=1 B=1 C=1 y=24 ABC=311
2 A=1 C=1 B=1 y=24 ACB=311
1 A=1 B=1 C=1 y=48 ABC=911
2 A=1 C=1 B=1 y=48 ACB=911
2 A=2 C=2 B=1 y=14 ACB=321
1 A=5 B=1 C=5 y=11 ABC=615
3 B=1 A=4 C=7 y=2 BAC=147
0 Replies
 
centrox
 
  1  
Reply Fri 26 Jan, 2018 09:55 am
Correction

Code:b = 1
for c in range(0, 10, 1):
for a in range(0, 10, 1):
for y in range(1, 101,1):
vallhs=eval("("+str(int(str(c)+str(a)))+"*"+str(y)+")"+"-1")
if vallhs==int(str(a)+str(b)+str(c)):
print "1 A="+str(a),"B="+str(b),"C="+str(c),"y="+str(y),"ABC="+str(vallhs)
if vallhs==int(str(a)+str(c)+str(b)):
print "2 A="+str(a),"C="+str(c),"B="+str(b),"y="+str(y),"ACB="+str(vallhs)
if vallhs==int(str(b)+str(a)+str(c)):
print "3 B="+str(b),"A="+str(a),"C="+str(c),"y="+str(y),"BAC="+str(vallhs)


Result

Code:1 A=3 B=1 C=1 y=24 ABC=311
2 A=3 C=1 B=1 y=24 ACB=311
1 A=9 B=1 C=1 y=48 ABC=911
2 A=9 C=1 B=1 y=48 ACB=911
2 A=3 C=2 B=1 y=14 ACB=321
1 A=6 B=1 C=5 y=11 ABC=615
3 B=1 A=4 C=7 y=2 BAC=147
whimsical
 
  1  
Reply Wed 31 Jan, 2018 04:57 am
@centrox,
Thanks very much. Cool
markr
 
  1  
Reply Fri 2 Feb, 2018 10:22 pm
@whimsical,
Hi Whim!!!
It's been a while...

Here are the solutions without the -1.

02 * 60 = 120
04 * 35 = 140
05 * 30 = 150
28 * 29 = 812
68 * 12 = 816
whimsical
 
  1  
Reply Sun 4 Feb, 2018 12:46 pm
@markr,
Hi Mark

Good to see you are still around answering questions.
True, it's been a while. I am still dabbling with puzzles, but I had a period that I had enough and needed to do something else. But sometimes I get ideas for a puzzle that need some checking first.

Thanks for the help.
Whim.
0 Replies
 
 

Related Topics

Riddle 44 - Question by lemal15
Christmas Math - Question by libertydawn
the soldier - Question by coacoa09
Marbles in a Bag - Riddle - Question by Valedictum
Sneaky Sequences - Question by Rainy
BOXES AND BOXES - Question by Valedictum
Whats 2 of 7 but not a number? - Discussion by Yams67
A personification riddle - Discussion by Gollumscave
Riddle: a predator - Discussion by Gollumscave
 
  1. Forums
  2. » Math riddle
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/24/2024 at 12:14:38