Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

numerical challenge

93 views
Skip to first unread message

RichD

unread,
Oct 22, 2012, 9:31:00 PM10/22/12
to
I saw this posed as an interview question:

(usual exponent notation)
What are the last 3 digits of 171 ^ 172?

Presumably, one is given pen and paper.

Is there a trick here? The second digit isn't too tough,
but the third is a lot of work.

--
Rich

Phil Hobbs

unread,
Oct 22, 2012, 10:07:03 PM10/22/12
to
If you interpret it in C, 171 XOR 172, it's not that hard:

171 = 160+11 = 0xAB
172 = 160+12 = 0xAC

0xB = 0b1011
0xA = 0b1010

so 171 ^ 172 = 1.

If you interpret it as taking the 172nd power of 171, you could be there
awhile.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510 USA
+1 845 480 2058

hobbs at electrooptical dot net
http://electrooptical.net

RichD

unread,
Oct 22, 2012, 11:36:08 PM10/22/12
to
On Oct 22, Phil Hobbs <pcdhSpamMeSensel...@electrooptical.net> wrote:
> > I saw this posed as an interview question:
> > (usual exponent notation)
> > What are the last 3 digits of 171 ^ 172?
>
> > Presumably, one is given pen and paper.
> > Is there a trick here?  The second digit isn't too tough,
> > but the third is a lot of work.
>
> If you interpret it in C, 171 XOR 172, it's not that hard:
>
> 171 = 160+11 = 0xAB
> 172 = 160+12 = 0xAC
>
> 0xB = 0b1011
> 0xA = 0b1010
> so 171 ^ 172 = 1.

huh?

> If you interpret it as taking the 172nd power of 171, you could be there
> awhile.

I think you flunked the interiew.

--
Rich

William Elliot

unread,
Oct 22, 2012, 11:50:52 PM10/22/12
to
On Mon, 22 Oct 2012, RichD wrote:

> What are the last 3 digits of 171 ^ 172?
>
> Is there a trick here?

a = 171; d = 1000
b = 172 = 128 + 32 + 8 + 4

Calculate:
a^2 mod d = 241
a^4 = (a^2)^2 mod d = 241^2 mod d = 81

a^8 = (a^4)^2 mod d
a^32 = (a^8)^4 = [(a^8)^2]^2 mod d
a^128 = (a^32)^4 = [(a^32)^2]^2 mod d

and use those results to calculate

a^172 = a^128 a^32 a^8 a^4 mod d.

John Larkin

unread,
Oct 22, 2012, 11:58:35 PM10/22/12
to
That's a really stupid interview question for an electronic design
position.


--

John Larkin Highland Technology Inc
www.highlandtechnology.com jlarkin at highlandtechnology dot com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators

William Elliot

unread,
Oct 23, 2012, 12:03:20 AM10/23/12
to
Another way is to calculate
a^3 mod d, a^9 = (a^3)^3 mod d,
etc. and use 172 = 2 * 81 + 9 + 1

Phil Hobbs

unread,
Oct 23, 2012, 12:04:23 AM10/23/12
to
I'm glad about that. I prefer working on fun stuff, of which I have
lots at the moment.
Message has been deleted
Message has been deleted

Tim Williams

unread,
Oct 23, 2012, 12:20:05 AM10/23/12
to
Presumably, one is given a script interpreter? :)

d3_N = ((171^N) mod 1000) / 100
gets the repeating string:
22085059234420727145664294936788641615890086383701
The 172 mod 50 = 22nd digit (in from the left of this string) is a 6.

Tim

--
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms

"RichD" <r_dela...@yahoo.com> wrote in message
news:384e8e6c-7de0-4386...@v11g2000pbs.googlegroups.com...

Sylvia Else

unread,
Oct 23, 2012, 1:20:00 AM10/23/12
to
Don't know about a trick. After noting the (*) result below using a
caculator, I managed to get the right answer from scratch on a
whiteboard, but I doubt I'd have managed to do it in an interview
environment.

Anyway, since we're only looking at the last three digits, we can do
calculations mod 1000.

Also, note that 172 is 4 * 43.

Doing 171^2 by long multiplication, keeping only the last three digits
gives 241.

241^2 by long multiplication, keeping only the last three digits is 81.

So 171^4 = 81 mod 1000 (this is the * result) and 171^172 = 81^43 mod
1000 = 9^86 mod 1000.

Now 9 is 10 - 1, so we have 171^172 = (10 - 1)^86 mod 1000.

If we were to expand that using the binomial theorem, all the terms
would by multiples of 1000, and therefore unimportant, except the last
three.

The last three are

a)(86 * 85) / 2 * 10^2 * (-1)^84,
b) 86 * 10^1 * (-1)^85, and
c)(-1)^86.

a) can also be written 43 * 85 * 100, and since we're taking it modulo
1000, we need only multiply the 3 by the 5, giving 15, and keep only the
5, so a) is 500 mod 1000.

b) is -860

c) is 1

So the result is 500 - 860 + 1 = -359 mod 1000.

But that's negative, so add 1000 to make it positive, and the answer is 641.

Sylvia.













Sylvia Else

unread,
Oct 23, 2012, 2:03:50 AM10/23/12
to
Indeed thinking along similar lines, one can write 171 as (170 + 1).

So we need (170 + 1)^172 mod 1000.

Again, only the last three terms can be non-zero mod 1000.

a) (172 * 171) / 2 * 170^2
b) 172 * 170
c) 1

a) is 56 * 171 * 170^2.

170^2 is 900 mod (square the 7, and drop the leading 4).
Now mutiply by the 6 and 1, and drop the leading 5, gives 400.

b) is 2 * 170 + 70 * 70 mod 1000 = 340 + 900 mod 1000.

So the sum is 400 + 340 + 900 + 1 mod 1000, or, unsurprisingly 641.

Sylvia.






quasi

unread,
Oct 23, 2012, 7:29:26 AM10/23/12
to
Perhaps they want to make sure that you are both able and
willing to do some actual work.

Here's a hand analysis ...

Let x = 171^172.

First, evaluate x (mod 8) ...

Since x is an odd square,

x = 1 (mod 8)

Next, evaluate x (mod 125) ...

x = 171^172
= 46^172 (mod 125)
= (45+1)^172 (mod 125)
= C(172,2)*(45^2) + C(172,1)*45 + 1 (mod 125)
= (81*25) + (47*45) + 1 (mod 125)
= ((80 + 1)*25) + ((50-3)*(50-5)) + 1 (mod 125)
= (25) + (-150 + 15) + 1 (mod 125)
= 16 (mod 125)

The simultaneous congruences

x = 1 (mod 8)
x = 16 (mod 125)

imply

x = 641 (mod 1000)

so the last 3 digits of x are 641.

quasi

Phil Hobbs

unread,
Oct 23, 2012, 10:27:43 AM10/23/12
to
On 10/23/2012 12:09 AM, G. Morgan wrote:
> Phil Hobbs wrote:
>
>> If you interpret it as taking the 172nd power of 171, you could be there
>> awhile.
>
> That's how I interpret it.
>
> 3.2425961901630295961298609791066e+384

That's 172**172.

[pcdh@orthodox ~]$ mc2 'exp(ln(10)*(172*log(172)-384))'
3.242596190163031885571244

The answer to the question posed is that the last 3 digits are '641'.
(REXX to the rescue.)

[pcdh@orthodox ~]$ rexx rexxtry "numeric digits 500; result=1; do 172;
result = result*171; end; say result;"
1189408362050899232331742548544079352843642973887737980381143384247782716222833932275790528049591602801982365577332286115374553061109422815431261462944420553436302158846639937649074486702295858231061014815003701856067898072301499489535982821308553995236716650994484275639670292828652624433814244134653337397556701859802285204337784880847597171549786961194804353449316566215601255402641
................................ /home/pcdh/apps/rexxtry.rex on UNIX


Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510

Robert Macy

unread,
Oct 23, 2012, 12:18:01 PM10/23/12
to
WOW! Those jobs at McDonald's require more and more education!

Robert Macy

unread,
Oct 23, 2012, 12:24:33 PM10/23/12
to
On Oct 23, 7:27 am, Phil Hobbs
<pcdhSpamMeSensel...@electrooptical.net> wrote:
>...snip...
> [pcdh@orthodox ~]$ rexx rexxtry "numeric digits 500; result=1; do 172;
> result = result*171; end; say result;"
> 118940836205089923233174254854407935284364297388773798038114338424778271622­283393227579052804959160280198236557733228611537455306110942281543126146294­442055343630215884663993764907448670229585823106101481500370185606789807230­149948953598282130855399523671665099448427563967029282865262443381424413465­333739755670185980228520433778488084759717154978696119480435344931656621560­1255402641
>    ................................ /home/pcdh/apps/rexxtry.rex on UNIX
>
> Cheers
>
> Phil Hobbs
>
> --
> Dr Philip C D Hobbs
> Principal Consultant
> ElectroOptical Innovations LLC
> Optics, Electro-optics, Photonics, Analog Electronics
>
> 160 North State Road #203
> Briarcliff Manor NY 10510
>
> hobbs at electrooptical dot nethttp://electrooptical.net

decimal 171 * 172 = 29412
octal 171 * 172 = 34652
hex 171 * 172 = 21552

not sure the point of that question, except to see if the applicant
starts shaking.

I much prefer more 'imaginative' questions, like, "How many uses for a
standard cinder block, except its intended construction purpose, can
you think of?"

Supposed to be over 26, I could only think of around 6 and that
included using a a leather thong and tying it around your neck as a
super macho tiki god.

Jeff Liebermann

unread,
Oct 23, 2012, 2:53:35 PM10/23/12
to
On Mon, 22 Oct 2012 20:58:35 -0700, John Larkin
<jjla...@highNOTlandTHIStechnologyPART.com> wrote:

>That's a really stupid interview question for an electronic design
>position.

True, but it only gets worse. Job interview questions are drifting
from the irrelevant to the ridiculous. For example:
<http://www.glassdoor.com/Interview/engineer-interview-questions-SRCH_KO0,8.htm>
3,715 questions, none of which have anything to do with engineering.

In order to insure my place in infamy, I created my own irrelevant
questions. Well, not exactly a question, more of a process. I would
show the applicant a PCB from the company product, and ask them to
identify components that they've worked with in the past, and give a
short description on what they do. Ostensively, this was to gauge
experience. Most would recognize about 25% of the major RF
components, which was about what I would expect. I then explained
what the board did, what products it was used in, some of the parts
they missed, and generally filled in the blanks.

I would then give the applicant a tour of the factory, production
line, grab a cup of coffee, and return to my messy office where I
would hand the applicant the exact same PCB, and ask the exact same
question. The real test was whether they were paying attention and
how much of my explanation they were able to recall. 50% recognition
was typical. Exceptional engineers and techs, which unfortunately we
couldn't afford to hire, would come very close to 100% recognition and
recall.

Other companies use the interview for testing problem solving skills.
<http://en.wikipedia.org/wiki/Microsoft_Interview>
Now, that's what I call relevant questions. However, it's
occasionally abused by asking the applicant to solve a real problem
with a current product. I once interviewed at a company that did that
to me. I was presented with a large schematic of the product, and
asked to critique the design. After a few minutes of hasty back of
the envelope calculations, I declared the product to be over-designed,
a tolerance accumulation nightmare, and that there were several active
stages that were superfluous. I offered specific recommendations on
what should be changed. I then expect to be thanked for my brilliant
insights. Instead, I was diplomatically thrown out the door. It
seems that the manager that was conducting the interview had designed
the product, and did not take kindly to criticism. So much for a
relevant problem solving interview.

--
Jeff Liebermann je...@cruzio.com
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558

John Masters

unread,
Oct 23, 2012, 3:04:26 PM10/23/12
to
That happened to me years ago. Pretty much the same but mechanical
engineering not electronics. I had the satisfaction years later of the
guy who rejected me joining the company I worked for in a position
subordinate to me. Not that I let that influence me in my treatment
towards him. The company he worked for and which I had tried to join
had gone bust and he had fallen down a few rungs. Thin is, he wasn't
that good an engineer.
--
John Masters

Of those who say nothing, few are silent.
- Thomas Neill

John Larkin

unread,
Oct 23, 2012, 3:05:17 PM10/23/12
to
On Tue, 23 Oct 2012 11:53:35 -0700, Jeff Liebermann <je...@cruzio.com>
wrote:
You didn't want to work there, so it was a great interview.

This is my first-pass qualifier question.



+10V
|
|
|
|
C
+5V--------------B
E
|
|
1K
|
|
gnd

(drawn like a real schematic, on a whiteboard)

What is the base voltage? (one answer: 0.6!)
What is the emitter voltage?
What is the collector voltage?

What is the base current?
What is the emitter current?
What is the collector current?

Any other comments?


The best interview is to work on a real design problem, together on a
whiteboard, for a couple of hours.

I also like to ask people what they designed last, and to describe
some circuits.


--

John Larkin Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro acquisition and simulation

John Fields

unread,
Oct 23, 2012, 3:57:35 PM10/23/12
to
On Tue, 23 Oct 2012 12:05:17 -0700, John Larkin
<jla...@highlandtechnology.com> wrote:


>This is my first-pass qualifier question.
>
>
>
> +10V
> |
> |
> |
> |
> C
>+5V--------------B
> E
> |
> |
> 1K
> |
> |
> gnd
>
>(drawn like a real schematic, on a whiteboard)
>
>What is the base voltage? (one answer: 0.6!)

---
Since the base voltage is as surely +5V as the collector voltage is
10V, don't you mean "base-to-emitter voltage"?

Version 4
SHEET 1 948 680
WIRE 256 48 -48 48
WIRE 256 144 256 48
WIRE 192 192 64 192
WIRE 256 288 256 240
WIRE -48 304 -48 48
WIRE 64 304 64 192
WIRE -48 448 -48 384
WIRE 64 448 64 384
WIRE 64 448 -48 448
WIRE 256 448 256 368
WIRE 256 448 64 448
WIRE -48 512 -48 448
FLAG -48 512 0
SYMBOL npn 192 144 R0
SYMATTR InstName Q1
SYMATTR Value 2N2222
SYMBOL res 240 272 R0
SYMATTR InstName R1
SYMATTR Value 1000
SYMATTR SpiceLine ""
SYMBOL voltage 64 288 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value 5
SYMATTR Value2 ""
SYMATTR SpiceLine ""
SYMBOL voltage -48 288 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value 10
SYMATTR Value2 ""
SYMATTR SpiceLine ""
TEXT -24 480 Left 2 !.op
TEXT 392 104 Left 2 ;--- Operating Point ---\n \nV(n001): 10
voltage\nV(n002): 5 voltage\nV(n003): 4.30708
voltage\nIc(Q1): 0.00428639 device_current\nIb(Q1):
2.06893e-005 device_current\nIe(Q1): -0.00430708
device_current\nI(R1): 0.00430708 device_current\nI(V2):
-0.00428639 device_current\nI(V1): -2.06893e-005
device_current

--
JF

Phil Hobbs

unread,
Oct 23, 2012, 4:08:45 PM10/23/12
to
On 10/23/2012 03:57 PM, John Fields wrote:
> On Tue, 23 Oct 2012 12:05:17 -0700, John Larkin
> <jla...@highlandtechnology.com> wrote:
>
>
>> This is my first-pass qualifier question.
>>
>>
>>
>> +10V
>> |
>> |
>> |
>> |
>> C
>> +5V--------------B
>> E
>> |
>> |
>> 1K
>> |
>> |
>> gnd
>>
>> (drawn like a real schematic, on a whiteboard)
>>
>> What is the base voltage? (one answer: 0.6!)

I can't believe you SPICEd that. Did SPICE show the horrible oscillation?

(JL's '0.6' was one of the incorrect answers given by unsuccessful
candidates.)

John Larkin

unread,
Oct 23, 2012, 4:44:22 PM10/23/12
to
On Tue, 23 Oct 2012 14:57:35 -0500, John Fields
<jfi...@austininstruments.com> wrote:

>On Tue, 23 Oct 2012 12:05:17 -0700, John Larkin
><jla...@highlandtechnology.com> wrote:
>
>
>>This is my first-pass qualifier question.
>>
>>
>>
>> +10V
>> |
>> |
>> |
>> |
>> C
>>+5V--------------B
>> E
>> |
>> |
>> 1K
>> |
>> |
>> gnd
>>
>>(drawn like a real schematic, on a whiteboard)
>>
>>What is the base voltage? (one answer: 0.6!)
>
>---
>Since the base voltage is as surely +5V as the collector voltage is
>10V, don't you mean "base-to-emitter voltage"?

Those are the questions that I ask.
Applicants are supposed to answer immediately, not go off and run
Spice.

John S

unread,
Oct 23, 2012, 4:44:56 PM10/23/12
to
Damn! I sure hope somebody read Sylvia's post. Very nice!

Nico Coesel

unread,
Oct 23, 2012, 6:06:25 PM10/23/12
to
John Larkin <jjla...@highNOTlandTHIStechnologyPART.com> wrote:

>On Mon, 22 Oct 2012 18:31:00 -0700 (PDT), RichD
><r_dela...@yahoo.com> wrote:
>
>>I saw this posed as an interview question:
>>
>>(usual exponent notation)
>>What are the last 3 digits of 171 ^ 172?
>>
>>Presumably, one is given pen and paper.
>>
>>Is there a trick here? The second digit isn't too tough,
>>but the third is a lot of work.
>
>That's a really stupid interview question for an electronic design
>position.

It would be a valid question if you apply for a job as a stock broker.
Interestingly quite a few people know how to break it down. I wouldn't
but that probably indicates there is little practical use for solving
these kind of algebra problems :-)

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
nico@nctdevpuntnl (punt=.)
--------------------------------------------------------------

John Fields

unread,
Oct 23, 2012, 6:07:11 PM10/23/12
to
On Tue, 23 Oct 2012 13:44:22 -0700, John Larkin
<jla...@highlandtechnology.com> wrote:

>On Tue, 23 Oct 2012 14:57:35 -0500, John Fields
><jfi...@austininstruments.com> wrote:
>
>>On Tue, 23 Oct 2012 12:05:17 -0700, John Larkin
>><jla...@highlandtechnology.com> wrote:
>>
>>
>>>This is my first-pass qualifier question.
>>>
>>>
>>>
>>> +10V
>>> |
>>> |
>>> |
>>> |
>>> C
>>>+5V--------------B
>>> E
>>> |
>>> |
>>> 1K
>>> |
>>> |
>>> gnd
>>>
>>>(drawn like a real schematic, on a whiteboard)
>>>
>>>What is the base voltage? (one answer: 0.6!)
>>
>>---
>>Since the base voltage is as surely +5V as the collector voltage is
>>10V, don't you mean "base-to-emitter voltage"?
>
>Those are the questions that I ask.

---
Well, OK, but since one usually refers to voltage with respect to 0V,
(GND) as you have when referring to the collector voltage, your
statement: "(one answer: 0.6!)" is flawed unless you're referring to
the base-to-emitter voltage.

That is, of course, unless the wire connecting the 5V supply to the
base exhibits an extraordinarily high resistance.

My point is that if someone with a critical eye was looking for
employment and took your test, their proper response to the base
voltage being 5V would be cause enough for you to leave them on the
street since you're dead set on the answer being 0.6V.
---
---
But, since I'm not an applicant and I don't have a vested interest in
mollycoddling you, I can do whatever I want to in order to show you up
for the bullshit artist you are.

--
JF

John Larkin

unread,
Oct 23, 2012, 6:35:57 PM10/23/12
to
On Tue, 23 Oct 2012 17:07:11 -0500, John Fields
Of course the answer was flawed. The guy who said that was an idiot,
and I didn't hire him.
You would have obviously flunked the test.

Les Cargill

unread,
Oct 23, 2012, 6:38:26 PM10/23/12
to
Jeff Liebermann wrote:
> On Mon, 22 Oct 2012 20:58:35 -0700, John Larkin
<snip>
>
> Other companies use the interview for testing problem solving skills.
> <http://en.wikipedia.org/wiki/Microsoft_Interview>
> Now, that's what I call relevant questions. However, it's
> occasionally abused by asking the applicant to solve a real problem
> with a current product. I once interviewed at a company that did that
> to me. I was presented with a large schematic of the product, and
> asked to critique the design. After a few minutes of hasty back of
> the envelope calculations, I declared the product to be over-designed,
> a tolerance accumulation nightmare, and that there were several active
> stages that were superfluous. I offered specific recommendations on
> what should be changed. I then expect to be thanked for my brilliant
> insights. Instead, I was diplomatically thrown out the door. It
> seems that the manager that was conducting the interview had designed
> the product, and did not take kindly to criticism. So much for a
> relevant problem solving interview.
>


That interview worked *just fine*. You didn't wanna work for him anyway...

--
Les Cargill

ehsjr

unread,
Oct 23, 2012, 6:48:34 PM10/23/12
to
On 10/22/2012 9:31 PM, RichD wrote:
> I saw this posed as an interview question:
>
> (usual exponent notation)
> What are the last 3 digits of 171 ^ 172?
>
> Presumably, one is given pen and paper.
>
> Is there a trick here? The second digit isn't too tough,
> but the third is a lot of work.
>
> --
> Rich
>

The last three digits of 171 ^ 172 are 172

The question didn't ask for the last three digits
of the result.

Ed

Sylvia Else

unread,
Oct 23, 2012, 6:51:04 PM10/23/12
to
On 23/10/2012 12:31 PM, RichD wrote:
> I saw this posed as an interview question:
>
> (usual exponent notation)
> What are the last 3 digits of 171 ^ 172?
>
> Presumably, one is given pen and paper.
>
> Is there a trick here? The second digit isn't too tough,
> but the third is a lot of work.
>
> --
> Rich
>

This appears to originate from

http://blog.brilliantscholars.com/2012/10/08/live-challenge-algebranumber-theory-5/

Solutions similar to those that I and others have posted in this thread
are given there, but the original post implies that there's a single
line solution. If there is, I can't see it.

I have noted that 171 = 900 - 9^3, which looks a bit interesting, but I
haven't been able to make anything of it in the sense of achieving a
one-line answer.

Sylvia.

P E Schoen

unread,
Oct 23, 2012, 6:53:59 PM10/23/12
to
"Jeff Liebermann" wrote in message
news:pqnd88lda35cjf4o3...@4ax.com...

[snip]
> I once interviewed at a company that did that
> to me. I was presented with a large schematic of the
> product, and asked to critique the design. After a few
> minutes of hasty back of the envelope calculations, I
> declared the product to be over-designed,
> a tolerance accumulation nightmare, and that there
> were several active stages that were superfluous.
> I offered specific recommendations on
> what should be changed. I then expect to be thanked
> for my brilliant insights. Instead, I was diplomatically
> thrown out the door. It seems that the manager that
> was conducting the interview had designed
> the product, and did not take kindly to criticism.
> So much for a relevant problem solving interview.

Maybe he just used you as an expert consultant without having to pay you. If
he did the same thing with many knowledgeable applicants he might have
gotten all the information he needed to redesign the product properly,
without paying for an employee or contractor.

Paul

Message has been deleted

Frederick Williams

unread,
Oct 23, 2012, 7:20:52 PM10/23/12
to
Robert Macy wrote:
>


I saw this posed as an interview question:

(usual exponent notation)
What are the last 3 digits of 171 ^ 172?

Presumably, one is given pen and paper.

Is there a trick here? The second digit isn't too tough,
but the third is a lot of work.

>
> decimal 171 * 172 = 29412
> octal 171 * 172 = 34652
> hex 171 * 172 = 21552
>
> not sure the point of that question, [...]

That'll be why you didn't answer it.

--
Where are the songs of Summer?--With the sun,
Oping the dusky eyelids of the south,
Till shade and silence waken up as one,
And morning sings with a warm odorous mouth.

Sylvia Else

unread,
Oct 23, 2012, 7:29:41 PM10/23/12
to
On 24/10/2012 9:06 AM, Nico Coesel wrote:
> John Larkin <jjla...@highNOTlandTHIStechnologyPART.com> wrote:
>
>> On Mon, 22 Oct 2012 18:31:00 -0700 (PDT), RichD
>> <r_dela...@yahoo.com> wrote:
>>
>>> I saw this posed as an interview question:
>>>
>>> (usual exponent notation)
>>> What are the last 3 digits of 171 ^ 172?
>>>
>>> Presumably, one is given pen and paper.
>>>
>>> Is there a trick here? The second digit isn't too tough,
>>> but the third is a lot of work.
>>
>> That's a really stupid interview question for an electronic design
>> position.
>
> It would be a valid question if you apply for a job as a stock broker.

Perhaps not even then. All the offered solutions require knowledge of
congruences, which is part of basic number theory. Unless a person has
done a maths degree, or happens to have encountered it in passing (my
situation), they're unlikely to be sure that the required steps are
mathematically valid.

I can't imagine number theory having much application either to
electronics or stock-broking.

Its most obvious use, outside pure-maths, is in cryptography, but if
you're interviewing someone for such a role, there are likely to be much
better questions.

Sylvia.

John Fields

unread,
Oct 23, 2012, 7:54:29 PM10/23/12
to
On Tue, 23 Oct 2012 15:35:57 -0700, John Larkin
---
So, just because you wrongly expected the candidate's answer to be
"0.6V" and his answer was "5V" and right, but not to your liking, you
put him back on the street?

Typical Larkinese.
---
---
Flunking a shit test is no disgrace.


--
JF

Jamie

unread,
Oct 23, 2012, 8:16:15 PM10/23/12
to
wtf!!!

Can't you do that in your head?

Jamie

Mike Terry

unread,
Oct 23, 2012, 8:25:37 PM10/23/12
to

"Sylvia Else" <syl...@not.at.this.address> wrote in message
news:aeolaq...@mid.individual.net...
Well, perhaps: (dropping all multiples of 1000 as in your other posts)

( 900 - 9^3 )^172 = ( 100 + (10-1)^3 )^172
= (10 - 1)^516 + 100 * 172 * (10 - 1)^513
= (1 - 160) + 200 * (-1 + 130)
= 1 - 160 - 200 = 641

This is easy on the calculations, but not just a single line....

Regards,
Mike.



k...@att.bizzzzzzzzzzzz

unread,
Oct 23, 2012, 8:35:44 PM10/23/12
to
On Tue, 23 Oct 2012 18:54:29 -0500, John Fields
Good Lord. You can't read either. You're as bad as Bloggs.

>Typical Larkinese.

Typical Fields. Stupid as a stump.
One that simple is. ...at least for someone who thinks they can design.

k...@att.bizzzzzzzzzzzz

unread,
Oct 23, 2012, 8:36:06 PM10/23/12
to
Did you expect otherwise?

Nico Coesel

unread,
Oct 23, 2012, 8:57:30 PM10/23/12
to
Sylvia Else <syl...@not.at.this.address> wrote:

>On 24/10/2012 9:06 AM, Nico Coesel wrote:
>> John Larkin <jjla...@highNOTlandTHIStechnologyPART.com> wrote:
>>
>>> On Mon, 22 Oct 2012 18:31:00 -0700 (PDT), RichD
>>> <r_dela...@yahoo.com> wrote:
>>>
>>>> I saw this posed as an interview question:
>>>>
>>>> (usual exponent notation)
>>>> What are the last 3 digits of 171 ^ 172?
>>>>
>>>> Presumably, one is given pen and paper.
>>>>
>>>> Is there a trick here? The second digit isn't too tough,
>>>> but the third is a lot of work.
>>>
>>> That's a really stupid interview question for an electronic design
>>> position.
>>
>> It would be a valid question if you apply for a job as a stock broker.
>
>Perhaps not even then. All the offered solutions require knowledge of
>congruences, which is part of basic number theory. Unless a person has
>done a maths degree, or happens to have encountered it in passing (my
>situation), they're unlikely to be sure that the required steps are
>mathematically valid.
>
>I can't imagine number theory having much application either to
>electronics or stock-broking.

I've seen job interview tests for stock brokers. About 1/3 of such a
test consists of 'numerical challenges' like the one above. From every
30 to 40 applicants there is maybe one that might be suitable for the
job.

Sylvia Else

unread,
Oct 23, 2012, 9:27:27 PM10/23/12
to
Well, that's closer than I got. Damnation, I should have spotted that
900 is -100 mod 1000.

The cited page suggests to me that the one line solution will not
involve the binomial theorem.

Sylvia.

mbuck

unread,
Oct 23, 2012, 9:41:37 PM10/23/12
to
On Tuesday, October 23, 2012 9:31:01 AM UTC+8, RichD wrote:
> I saw this posed as an interview question:
>
>
>
> (usual exponent notation)
>
> What are the last 3 digits of 171 ^ 172?
>
>
>
> Presumably, one is given pen and paper.
>
>
>
> Is there a trick here? The second digit isn't too tough,
>
> but the third is a lot of work.
>
>
>
> --
>
> Rich

The third? If you mean the last digit; that's trivial.

John Larkin

unread,
Oct 23, 2012, 10:01:46 PM10/23/12
to
There's no point conversing with Fields or Bloggs. They are both a lot
more crabby than they are sensible.

Neither is an engineer, either.


--

John Larkin Highland Technology Inc
www.highlandtechnology.com jlarkin at highlandtechnology dot com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators

YD

unread,
Oct 23, 2012, 10:34:29 PM10/23/12
to
Late at night, by candle light, John Fields
<jfi...@austininstruments.com> penned this immortal opus:
Larkin showed one of the _incorrect_ answers. Maybe not very clear to
all, but most of us seem to have understood it.

Your need to have everything spelled out in excruciating detail is
symptomatic of some kind of comprehension deficiency. There are meds
for that, speak to a doctor.

- YD.

--
Remove HAT if replying by mail.

John Larkin

unread,
Oct 23, 2012, 10:38:25 PM10/23/12
to
No, he's just a prissy old hen. There are no drugs for that.




--

John Larkin Highland Technology Inc
www.highlandtechnology.com jlarkin at highlandtechnology dot com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links

k...@att.bizzzzzzzzzzzz

unread,
Oct 23, 2012, 10:39:23 PM10/23/12
to
I actually thought Bloggs was, until the Solyndra thing. Truly amazing.

Robert Baer

unread,
Oct 24, 2012, 12:27:37 AM10/24/12
to
Sylvia Else wrote:
> On 23/10/2012 4:20 PM, Sylvia Else wrote:
>> On 23/10/2012 12:31 PM, RichD wrote:
>>> I saw this posed as an interview question:
>>>
>>> (usual exponent notation)
>>> What are the last 3 digits of 171 ^ 172?
>>>
>>> Presumably, one is given pen and paper.
>>>
>>> Is there a trick here? The second digit isn't too tough,
>>> but the third is a lot of work.
>>>
>>> --
>>> Rich
>>>
>>
>> Don't know about a trick. After noting the (*) result below using a
>> caculator, I managed to get the right answer from scratch on a
>> whiteboard, but I doubt I'd have managed to do it in an interview
>> environment.
>>
>> Anyway, since we're only looking at the last three digits, we can do
>> calculations mod 1000.
>>
>> Also, note that 172 is 4 * 43.
>>
>> Doing 171^2 by long multiplication, keeping only the last three digits
>> gives 241.
>>
>> 241^2 by long multiplication, keeping only the last three digits is 81.
>>
>> So 171^4 = 81 mod 1000 (this is the * result) and 171^172 = 81^43 mod
>> 1000 = 9^86 mod 1000.
>>
>> Now 9 is 10 - 1, so we have 171^172 = (10 - 1)^86 mod 1000.
>>
>> If we were to expand that using the binomial theorem, all the terms
>> would by multiples of 1000, and therefore unimportant, except the last
>> three.
>>
>> The last three are
>>
>> a)(86 * 85) / 2 * 10^2 * (-1)^84,
>> b) 86 * 10^1 * (-1)^85, and
>> c)(-1)^86.
>>
>> a) can also be written 43 * 85 * 100, and since we're taking it modulo
>> 1000, we need only multiply the 3 by the 5, giving 15, and keep only the
>> 5, so a) is 500 mod 1000.
>>
>> b) is -860
>>
>> c) is 1
>>
>> So the result is 500 - 860 + 1 = -359 mod 1000.
>>
>> But that's negative, so add 1000 to make it positive, and the answer is
>> 641.
>>
>> Sylvia.
>
> Indeed thinking along similar lines, one can write 171 as (170 + 1).
>
> So we need (170 + 1)^172 mod 1000.
>
> Again, only the last three terms can be non-zero mod 1000.
>
> a) (172 * 171) / 2 * 170^2
> b) 172 * 170
> c) 1
>
> a) is 56 * 171 * 170^2.
>
> 170^2 is 900 mod (square the 7, and drop the leading 4).
> Now mutiply by the 6 and 1, and drop the leading 5, gives 400.
>
> b) is 2 * 170 + 70 * 70 mod 1000 = 340 + 900 mod 1000.
>
> So the sum is 400 + 340 + 900 + 1 mod 1000, or, unsurprisingly 641.
>
> Sylvia.
>
>
>
>
>
>
I am reminded of another "puzzle": how many terminal zeros are there
in 4089! (4089 factorial)?
Solve it in less that (say) ten minutes.
No electronic or mechanical calculator allowed.

Sylvia Else

unread,
Oct 23, 2012, 11:42:34 PM10/23/12
to
On 24/10/2012 6:05 AM, John Larkin wrote:
> On Tue, 23 Oct 2012 11:53:35 -0700, Jeff Liebermann <je...@cruzio.com>
> wrote:
>
>> On Mon, 22 Oct 2012 20:58:35 -0700, John Larkin
>> <jjla...@highNOTlandTHIStechnologyPART.com> wrote:
>>
>>> That's a really stupid interview question for an electronic design
>>> position.
>>
>> True, but it only gets worse. Job interview questions are drifting
>>from the irrelevant to the ridiculous. For example:
>> <http://www.glassdoor.com/Interview/engineer-interview-questions-SRCH_KO0,8.htm>
>> 3,715 questions, none of which have anything to do with engineering.
>>
>> In order to insure my place in infamy, I created my own irrelevant
>> questions. Well, not exactly a question, more of a process. I would
>> show the applicant a PCB from the company product, and ask them to
>> identify components that they've worked with in the past, and give a
>> short description on what they do. Ostensively, this was to gauge
>> experience. Most would recognize about 25% of the major RF
>> components, which was about what I would expect. I then explained
>> what the board did, what products it was used in, some of the parts
>> they missed, and generally filled in the blanks.
>>
>> I would then give the applicant a tour of the factory, production
>> line, grab a cup of coffee, and return to my messy office where I
>> would hand the applicant the exact same PCB, and ask the exact same
>> question. The real test was whether they were paying attention and
>> how much of my explanation they were able to recall. 50% recognition
>> was typical. Exceptional engineers and techs, which unfortunately we
>> couldn't afford to hire, would come very close to 100% recognition and
>> recall.
>>
>> Other companies use the interview for testing problem solving skills.
>> <http://en.wikipedia.org/wiki/Microsoft_Interview>
>> Now, that's what I call relevant questions. However, it's
>> occasionally abused by asking the applicant to solve a real problem
>> with a current product. I once interviewed at a company that did that
>> to me. I was presented with a large schematic of the product, and
>> asked to critique the design. After a few minutes of hasty back of
>> the envelope calculations, I declared the product to be over-designed,
>> a tolerance accumulation nightmare, and that there were several active
>> stages that were superfluous. I offered specific recommendations on
>> what should be changed. I then expect to be thanked for my brilliant
>> insights. Instead, I was diplomatically thrown out the door. It
>> seems that the manager that was conducting the interview had designed
>> the product, and did not take kindly to criticism. So much for a
>> relevant problem solving interview.
>
> You didn't want to work there, so it was a great interview.
>
> This is my first-pass qualifier question.
>
>
>
> +10V
> |
> |
> |
> |
> C
> +5V--------------B
> E
> |
> |
> 1K
> |
> |
> gnd
>
> (drawn like a real schematic, on a whiteboard)
>
> What is the base voltage? (one answer: 0.6!)

During the dot.com bubble, I worked for a software company that would
(by way of analogy) have employed the person on the grounds that they at
least knew which was the base. Apparently, the management thought that
any 'programmer' was better than no programmer.

Sylvia.

William Elliot

unread,
Oct 24, 2012, 12:59:47 AM10/24/12
to
On Tue, 23 Oct 2012, Robert Baer wrote:
> > On 23/10/2012 4:20 PM, Sylvia Else wrote:
> > > On 23/10/2012 12:31 PM, RichD wrote:

> > > > What are the last 3 digits of 171 ^ 172?
> >
> > Indeed thinking along similar lines, one can write 171 as (170 + 1).
> >
> > So we need (170 + 1)^172 mod 1000.
> >
> > Again, only the last three terms can be non-zero mod 1000.
> >
> > a) (172 * 171) / 2 * 170^2
> > b) 172 * 170
> > c) 1
> >
> > a) is 56 * 171 * 170^2.
> >
> > 170^2 is 900 mod (square the 7, and drop the leading 4).
> > Now mutiply by the 6 and 1, and drop the leading 5, gives 400.
> >
> > b) is 2 * 170 + 70 * 70 mod 1000 = 340 + 900 mod 1000.
> >
> > So the sum is 400 + 340 + 900 + 1 mod 1000, or, unsurprisingly 641.
> >
> I am reminded of another "puzzle": how many terminal zeros are there in
> 4089! (4089 factorial)?

817. 5 divides every fifth number. 4089/5 = 817 + 4/5

Butch Malahide

unread,
Oct 24, 2012, 1:40:06 AM10/24/12
to
Wrong. Hint: 25! has 6 terminal zeros.

William Elliot

unread,
Oct 24, 2012, 4:04:35 AM10/24/12
to
Anoher 5 divides every 25-th number. 4089/25 = 163 + 14/25
Yet another 5 divides every 125-th number. 4089/125 = 32 + 89/125
etc.

Number of zero's
= [4089/5] + [4089//25] + [4089/125] + [4089/625] + [4089//3125]
= 817 + 163 + 32 + 6 + 1 = 1019.



Uwe Hercksen

unread,
Oct 24, 2012, 7:01:34 AM10/24/12
to


Sylvia Else schrieb:

> Indeed thinking along similar lines, one can write 171 as (170 + 1).
>
> So we need (170 + 1)^172 mod 1000.
>
> Again, only the last three terms can be non-zero mod 1000.
>
> a) (172 * 171) / 2 * 170^2
> b) 172 * 170
> c) 1
>
> a) is 56 * 171 * 170^2.
>
> 170^2 is 900 mod (square the 7, and drop the leading 4).
> Now mutiply by the 6 and 1, and drop the leading 5, gives 400.
>
> b) is 2 * 170 + 70 * 70 mod 1000 = 340 + 900 mod 1000.
>
> So the sum is 400 + 340 + 900 + 1 mod 1000, or, unsurprisingly 641.

Hello,

I think there is a typing error in this line:
a) is 56 * 171 * 170^2
it should be
a) is 86 * 171 * 170^2.
172/2 is 86 not 56

But this error does not influence the result because the 5 or 8 is
dropped anyway.

But I love this very clever calculation.

Bye

Spehro Pefhany

unread,
Oct 24, 2012, 7:42:21 AM10/24/12
to
On Tue, 23 Oct 2012 10:27:43 -0400, the renowned Phil Hobbs
<pcdhSpamM...@electrooptical.net> wrote:

>On 10/23/2012 12:09 AM, G. Morgan wrote:
>> Phil Hobbs wrote:
>>
>>> If you interpret it as taking the 172nd power of 171, you could be there
>>> awhile.
>>
>> That's how I interpret it.
>>
>> 3.2425961901630295961298609791066e+384
>
>That's 172**172.
>
>[pcdh@orthodox ~]$ mc2 'exp(ln(10)*(172*log(172)-384))'
>3.242596190163031885571244
>
>The answer to the question posed is that the last 3 digits are '641'.
>(REXX to the rescue.)
>
>[pcdh@orthodox ~]$ rexx rexxtry "numeric digits 500; result=1; do 172;
>result = result*171; end; say result;"
>1189408362050899232331742548544079352843642973887737980381143384247782716222833932275790528049591602801982365577332286115374553061109422815431261462944420553436302158846639937649074486702295858231061014815003701856067898072301499489535982821308553995236716650994484275639670292828652624433814244134653337397556701859802285204337784880847597171549786961194804353449316566215601255402641
> ................................ /home/pcdh/apps/rexxtry.rex on UNIX
>
>
>Cheers
>
>Phil Hobbs

Or MATLAB:-

>> vpa(sym(171)^sym(172), 5000)

ans =

1189408362050899232331742548544079352843642973887737980381143384247782716222833932275790528049591602801982365577332286115374553061109422815431261462944420553436302158846639937649074486702295858231061014815003701856067898072301499489535982821308553995236716650994484275639670292828652624433814244134653337397556701859802285204337784880847597171549786961194804353449316566215601255402641.



Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
sp...@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com

Sylvia Else

unread,
Oct 24, 2012, 7:53:45 AM10/24/12
to
On 24/10/2012 10:01 PM, Uwe Hercksen wrote:
>
>
> Sylvia Else schrieb:
>
>> Indeed thinking along similar lines, one can write 171 as (170 + 1).
>>
>> So we need (170 + 1)^172 mod 1000.
>>
>> Again, only the last three terms can be non-zero mod 1000.
>>
>> a) (172 * 171) / 2 * 170^2
>> b) 172 * 170
>> c) 1
>>
>> a) is 56 * 171 * 170^2.
>>
>> 170^2 is 900 mod (square the 7, and drop the leading 4).
>> Now mutiply by the 6 and 1, and drop the leading 5, gives 400.
>>
>> b) is 2 * 170 + 70 * 70 mod 1000 = 340 + 900 mod 1000.
>>
>> So the sum is 400 + 340 + 900 + 1 mod 1000, or, unsurprisingly 641.
>
> Hello,
>
> I think there is a typing error in this line:

Sadly, my typing is more accurate than my calculating, so it's probably
the latter that went astray. Well spotted.

> a) is 56 * 171 * 170^2
> it should be
> a) is 86 * 171 * 170^2.
> 172/2 is 86 not 56

>
> But this error does not influence the result because the 5 or 8 is
> dropped anyway.
>
> But I love this very clever calculation.
>
> Bye
>

Sylvia.

k...@att.bizzzzzzzzzzzz

unread,
Oct 24, 2012, 9:12:08 AM10/24/12
to
On Wed, 24 Oct 2012 14:42:34 +1100, Sylvia Else <syl...@not.at.this.address>
wrote:
With that answer? Are you sure? ;-)

>Apparently, the management thought that
>any 'programmer' was better than no programmer.

Been there. It's taken some convincing, at times, to get management to
understand that sometimes more people = less work. It's often too late to
improve a schedule, by *any* means.

k...@att.bizzzzzzzzzzzz

unread,
Oct 24, 2012, 9:18:25 AM10/24/12
to
On Tue, 23 Oct 2012 20:27:37 -0800, Robert Baer <rober...@localnet.com>
wrote:
452? A zero for every 10 (408), another for every 100 (in addition to the one
for the 10th 10) (+40), and another for every 1000 (+4).

Robert Macy

unread,
Oct 24, 2012, 10:51:14 AM10/24/12
to
On Oct 23, 4:20 pm, Frederick Williams <freddywilli...@btinternet.com>
wrote:
True.

Butch Malahide

unread,
Oct 24, 2012, 1:16:13 PM10/24/12
to
On Oct 24, 8:18 am, "k...@att.bizzzzzzzzzzzz"
<k...@att.bizzzzzzzzzzzz> wrote:
> On Tue, 23 Oct 2012 20:27:37 -0800, Robert Baer <robertb...@localnet.com>
How many terminal zeros do you think 5! has? (No fair calculating 5!,
just use the same reasoning you used for 4089!.)

k...@att.bizzzzzzzzzzzz

unread,
Oct 24, 2012, 2:01:38 PM10/24/12
to
I originally discounted 2s and 5s because the only 9*0 ends in zero (assumed
that the '9' made a difference - it doesn't). Obviously, there is also 2
times 5 in each decade, so there are 408 (x0) + 40 (x100) +4 (x1000) + 409
(2x5) = 861.

Willem

unread,
Oct 24, 2012, 2:41:33 PM10/24/12
to
k...@att.bizzzzzzzzzzzz wrote:
) I originally discounted 2s and 5s because the only 9*0 ends in zero (assumed
) that the '9' made a difference - it doesn't). Obviously, there is also 2
) times 5 in each decade, so there are 408 (x0) + 40 (x100) +4 (x1000) + 409
) (2x5) = 861.

I have no idea what you mean with 9*0 and why they should make a difference.

Also, you still made a mistake, 861 is not the right answer.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT

rickman

unread,
Oct 24, 2012, 9:35:56 AM10/24/12
to
Unlike many posters here, I typically trim my posts. But this one is so
classic that I want to include all of the context.

This is so clearly an issue of miscomunication that even I can spot it.
Yet no one is willing to go the extra mile and explain clearly enough
where the confusion is. Rather this collection of alleged professionals
prefer to begin name calling and abusing each other.

Larkin's post with the 0.6 Volt answer was saying this was an answer
that an applicant gave. I can see where this was misinterpreted as "one
valid answer" rather than "one applicant's answer". The rest of the
conversation really didn't explain any more clearly and was also
misinterpreted. Given the obvious context I can see why the following
comments were also misinterpreted.

Can't any of you act like adults?

They say that things are often said on the Internet that would not be
said if you were face to face. I wish there was a way to change that.

Rick

Roberto Waltman

unread,
Oct 24, 2012, 3:27:12 PM10/24/12
to
John Larkin wrote:
...

>This is my first-pass qualifier question.
>
> +10V
> |
> |
> C
>+5V--------------B
> E
> |
> 1K
> |
> gnd
>
>(drawn like a real schematic, on a whiteboard)
>
>What is the base voltage? (one answer: 0.6!)
>What is the emitter voltage?
>What is the collector voltage?
>
>What is the base current?
>What is the emitter current?
>What is the collector current?
>
>Any other comments?

Germanium or silicon?
PNP or NPN? ;)

Roberto Waltman
[Running for cover...]
--
Roberto Waltman

[ Please reply to the group,
return address is invalid ]

Spehro Pefhany

unread,
Oct 24, 2012, 3:46:55 PM10/24/12
to
On Wed, 24 Oct 2012 15:27:12 -0400, Roberto Waltman
<use...@rwaltman.com> wrote:

>John Larkin wrote:
>...
>
>>This is my first-pass qualifier question.
>>
>> +10V
>> |
>> |
>> C
>>+5V--------------B
>> E
>> |
>> 1K
>> |
>> gnd
>>
>>(drawn like a real schematic, on a whiteboard)
>>
>>What is the base voltage? (one answer: 0.6!)
>>What is the emitter voltage?
>>What is the collector voltage?
>>
>>What is the base current?
>>What is the emitter current?
>>What is the collector current?
>>
>>Any other comments?
>
>Germanium or silicon?
>PNP or NPN? ;)
>
>Roberto Waltman
>[Running for cover...]

For a (slightly) more advanced test..

>> -10V
>> |
>> 1K
>> |
>> C
>>-5V--------------B NPN
>> E
>> |
>> gnd
>>
>>


Spehro Pefhany

unread,
Oct 24, 2012, 3:55:55 PM10/24/12
to
On Wed, 24 Oct 2012 18:41:33 +0000 (UTC), Willem
<wil...@turtle.stack.nl> wrote:

>k...@att.bizzzzzzzzzzzz wrote:
>) I originally discounted 2s and 5s because the only 9*0 ends in zero (assumed
>) that the '9' made a difference - it doesn't). Obviously, there is also 2
>) times 5 in each decade, so there are 408 (x0) + 40 (x100) +4 (x1000) + 409
>) (2x5) = 861.
>
>I have no idea what you mean with 9*0 and why they should make a difference.
>
>Also, you still made a mistake, 861 is not the right answer.
>
>
>SaSW, Willem

I cheated and googled. Here is an easy general method, particularly
easy with a pocket calculator:-
http://www.purplemath.com/modules/factzero.htm

and I also get the correct answer from MATLAB by using:
vpa('4089!',50000)

Then copy/paste the zeros into Ultraedit and looking at the column
number of the last zero. xxx9.


tm

unread,
Oct 24, 2012, 4:01:45 PM10/24/12
to

"Roberto Waltman" <use...@rwaltman.com> wrote in message
news:creg88te3e848d041...@4ax.com...
Now we are getting somewhere.
Also need to know the Hfe to answer the Ib and Ie parts.

Might also be good to know the temperature and the transistor part number.


tm

unread,
Oct 24, 2012, 4:04:21 PM10/24/12
to

"Spehro Pefhany" <spef...@interlogDOTyou.knowwhat> wrote in message
news:29hg885qqllnciosd...@4ax.com...
LOL

Good one Spehro.
Better hope that B-E zener doesn't fire.

John Larkin

unread,
Oct 24, 2012, 4:19:59 PM10/24/12
to
It's impressive how many people don't understand emitter followers.
Like, I saw one audio amp that had a 2N3055 emitter-follower output, a
huge coupling cap to the speaker... and a 1K emitter pulldown
resistor.

But, to clarify, one job applicant actually said that the base voltage
was 0.6. I guess he felt that all base voltages are 0.6. One other guy
said that the collector voltage was 0.2, because the transistor is
saturated.




--

John Larkin Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro acquisition and simulation

John Larkin

unread,
Oct 24, 2012, 4:21:32 PM10/24/12
to
You might actually need to run for cover...

John Larkin

unread,
Oct 24, 2012, 4:25:33 PM10/24/12
to
On Wed, 24 Oct 2012 16:04:21 -0400, "tm" <No_on...@white-house.gov>
wrote:

>
>"Spehro Pefhany" <spef...@interlogDOTyou.knowwhat> wrote in message
>news:29hg885qqllnciosd...@4ax.com...
>> On Wed, 24 Oct 2012 15:27:12 -0400, Roberto Waltman
>> <use...@rwaltman.com> wrote:
>>
>>>John Larkin wrote:
>>>...
>>>
>>>>This is my first-pass qualifier question.
>>>>
>>>> +10V
>>>> |
>>>> |
>>>> C
>>>>+5V--------------B
>>>> E
>>>> |
>>>> 1K
>>>> |
>>>> gnd
>>>>
>>>>(drawn like a real schematic, on a whiteboard)
>>>>
>>>>What is the base voltage? (one answer: 0.6!)
>>>>What is the emitter voltage?
>>>>What is the collector voltage?
>>>>
>>>>What is the base current?
>>>>What is the emitter current?
>>>>What is the collector current?
>>>>
>>>>Any other comments?
>>>
>>>Germanium or silicon?
>>>PNP or NPN? ;)

I draw it as NPN on a whiteboard. I don't write E/B/C, so I get to
find out if he can name the bits of a transistor. The applicant is
free to ask any questions, which gives me more info.


>>>
>>>Roberto Waltman
>>>[Running for cover...]
>>
>> For a (slightly) more advanced test..
>>
>>>> -10V
>>>> |
>>>> 1K
>>>> |
>>>> C
>>>>-5V--------------B NPN
>>>> E
>>>> |
>>>> gnd
>>>>
>>>>
>>
>>
>LOL
>
>Good one Spehro.
>Better hope that B-E zener doesn't fire.

Surviving that, the problem is essentially identical to the one I
posted, with a bit more base current.

John Larkin

unread,
Oct 24, 2012, 4:27:27 PM10/24/12
to
On Wed, 24 Oct 2012 16:01:45 -0400, "tm" <No_on...@white-house.gov>
wrote:
I'd be happy for the applicant to make some assumptions (stated, if he
likes) and give me ballpark numbers. *Without* cranking up Spice on
his laptop.

Roberto Waltman

unread,
Oct 24, 2012, 4:27:02 PM10/24/12
to
One more question: What is the pressure of the magic smoke inside the
transistor?

k...@att.bizzzzzzzzzzzz

unread,
Oct 24, 2012, 4:36:49 PM10/24/12
to
On Wed, 24 Oct 2012 15:27:12 -0400, Roberto Waltman <use...@rwaltman.com>
wrote:

>John Larkin wrote:
>...
>
>>This is my first-pass qualifier question.
>>
>> +10V
>> |
>> |
>> C
>>+5V--------------B
>> E
>> |
>> 1K
>> |
>> gnd
>>
>>(drawn like a real schematic, on a whiteboard)
>>
>>What is the base voltage? (one answer: 0.6!)
>>What is the emitter voltage?
>>What is the collector voltage?
>>
>>What is the base current?
>>What is the emitter current?
>>What is the collector current?
>>
>>Any other comments?
>
>Germanium or silicon?

That information is only necessary for about half of the answers and changes
them less than 10%.


>PNP or NPN? ;)

...and that doesn't change 1/3 of the answers (but should cause some other
unsolicited comments, if PNP). ;-)

k...@att.bizzzzzzzzzzzz

unread,
Oct 24, 2012, 4:39:19 PM10/24/12
to
On Wed, 24 Oct 2012 15:46:55 -0400, Spehro Pefhany
<spef...@interlogDOTyou.knowwhat> wrote:

Same answer.

Spehro Pefhany

unread,
Oct 24, 2012, 4:44:06 PM10/24/12
to
On Wed, 24 Oct 2012 16:27:02 -0400, Roberto Waltman
If it's a jellybean NPN, the E-B junction is going to be just fine
(typically they break down around 8-9V and are rated for at least 5V),
and the answers are, as JL says, going to be about the same as his
example except for the higher base current due to typically low
reverse beta. But it fits a different visual pattern, being an NPN
with E grounded-- it's probably not obvious that it's a
"collector-follower".

P E Schoen

unread,
Oct 24, 2012, 4:44:12 PM10/24/12
to
"John Larkin" wrote in message
news:92jg885hcoerdehjd...@4ax.com...

[HUGE SNIP - ***HINT! ***]

> It's impressive how many people don't understand emitter followers.
> Like, I saw one audio amp that had a 2N3055 emitter-follower output, a
> huge coupling cap to the speaker... and a 1K emitter pulldown
> resistor.

> But, to clarify, one job applicant actually said that the base voltage
> was 0.6. I guess he felt that all base voltages are 0.6. One other guy
> said that the collector voltage was 0.2, because the transistor is
> saturated.

Yes, I think MOST of us got that right away. The base voltage error may have
been a misunderstanding as Vbe, but the saturation assumption was totally
wrong.

But the point was that the followup posts seemed to ignore that fact, as
well as continuing to keep a huge amount of irrelevant quoted content. The
suggestion to trim that was either missed or ignored, which implies
ignorance, apathy, or intentional annoyance. Maybe all three! :)

Paul

Roberto Waltman

unread,
Oct 24, 2012, 4:54:35 PM10/24/12
to
>If it's a jellybean NPN, the E-B junction is going to be just fine
>(typically they break down around 8-9V and are rated for at least 5V),
>and the answers are, as JL says, going to be about the same as his
>example except for the higher base current due to typically low
>reverse beta. But it fits a different visual pattern, being an NPN
>with E grounded-- it's probably not obvious that it's a
>"collector-follower".

Right - Didn't pay attention to the fact that the supplies are now
positive...

John Larkin

unread,
Oct 24, 2012, 6:53:30 PM10/24/12
to
That's way overkill for a first question interview. If some kid
doesn't know about reverse beta, I wouldn't chuck him out right away.

I measured a BFT25 as having reverse beta about 4.

Jamie

unread,
Oct 24, 2012, 7:22:24 PM10/24/12
to
And each time some one comments on that, I still try to think of an
application where that would prosper? Maybe something in speed switching
. etc..
Kind of reminds me of ECL logic in a way.

Jamie

John Fields

unread,
Oct 24, 2012, 7:11:43 PM10/24/12
to
On Wed, 24 Oct 2012 13:19:59 -0700, John Larkin
---
There is; get face to face.
---

>It's impressive how many people don't understand emitter followers.
>Like, I saw one audio amp that had a 2N3055 emitter-follower output, a
>huge coupling cap to the speaker... and a 1K emitter pulldown
>resistor.

---
If they didn't understand emitter followers, then it's doubtful they
could have gotten that circuit to work.

--
JF

John Larkin

unread,
Oct 24, 2012, 7:30:39 PM10/24/12
to
I have used a BFT25 to ground an AC-coupled analog signal, in a
gain-switching application. You need a lot of base current to clamp
the negative part of the swing, since reverse beta is low.

tm

unread,
Oct 24, 2012, 7:39:44 PM10/24/12
to

"John Larkin" <jla...@highlandtechnology.com> wrote in message
news:hcug88p745bp6jfpe...@4ax.com...
Why didn't you use a fet? Just askin'.


k...@att.bizzzzzzzzzzzz

unread,
Oct 24, 2012, 7:40:10 PM10/24/12
to
Some can't think without Spice, evidently.

k...@att.bizzzzzzzzzzzz

unread,
Oct 24, 2012, 7:41:54 PM10/24/12
to
On Wed, 24 Oct 2012 15:55:55 -0400, Spehro Pefhany
<spef...@interlogDOTyou.knowwhat> wrote:

>On Wed, 24 Oct 2012 18:41:33 +0000 (UTC), Willem
><wil...@turtle.stack.nl> wrote:
>
>>k...@att.bizzzzzzzzzzzz wrote:
>>) I originally discounted 2s and 5s because the only 9*0 ends in zero (assumed
>>) that the '9' made a difference - it doesn't). Obviously, there is also 2
>>) times 5 in each decade, so there are 408 (x0) + 40 (x100) +4 (x1000) + 409
>>) (2x5) = 861.
>>
>>I have no idea what you mean with 9*0 and why they should make a difference.
>>
>>Also, you still made a mistake, 861 is not the right answer.
>>
>>
>>SaSW, Willem
>
>I cheated and googled. Here is an easy general method, particularly
>easy with a pocket calculator:-
>http://www.purplemath.com/modules/factzero.htm

Yeah, I didn't count the 5x5(mod10)=5. That should add another 408 0's, give
or take a fence post.

Sylvia Else

unread,
Oct 24, 2012, 8:33:46 PM10/24/12
to
On 25/10/2012 12:12 AM, k...@att.bizzzzzzzzzzzz wrote:
> On Wed, 24 Oct 2012 14:42:34 +1100, Sylvia Else <syl...@not.at.this.address>
> wrote:
>
>> On 24/10/2012 6:05 AM, John Larkin wrote:
>>> On Tue, 23 Oct 2012 11:53:35 -0700, Jeff Liebermann <je...@cruzio.com>
>>> wrote:
>>>
>>>> On Mon, 22 Oct 2012 20:58:35 -0700, John Larkin
>>>> <jjla...@highNOTlandTHIStechnologyPART.com> wrote:
>>>>
>>>>> That's a really stupid interview question for an electronic design
>>>>> position.
>>>>
>>>> True, but it only gets worse. Job interview questions are drifting
>>> >from the irrelevant to the ridiculous. For example:
>>>> <http://www.glassdoor.com/Interview/engineer-interview-questions-SRCH_KO0,8.htm>
>>>> 3,715 questions, none of which have anything to do with engineering.
>>>>
>>>> In order to insure my place in infamy, I created my own irrelevant
>>>> questions. Well, not exactly a question, more of a process. I would
>>>> show the applicant a PCB from the company product, and ask them to
>>>> identify components that they've worked with in the past, and give a
>>>> short description on what they do. Ostensively, this was to gauge
>>>> experience. Most would recognize about 25% of the major RF
>>>> components, which was about what I would expect. I then explained
>>>> what the board did, what products it was used in, some of the parts
>>>> they missed, and generally filled in the blanks.
>>>>
>>>> I would then give the applicant a tour of the factory, production
>>>> line, grab a cup of coffee, and return to my messy office where I
>>>> would hand the applicant the exact same PCB, and ask the exact same
>>>> question. The real test was whether they were paying attention and
>>>> how much of my explanation they were able to recall. 50% recognition
>>>> was typical. Exceptional engineers and techs, which unfortunately we
>>>> couldn't afford to hire, would come very close to 100% recognition and
>>>> recall.
>>>>
>>>> Other companies use the interview for testing problem solving skills.
>>>> <http://en.wikipedia.org/wiki/Microsoft_Interview>
>>>> Now, that's what I call relevant questions. However, it's
>>>> occasionally abused by asking the applicant to solve a real problem
>>>> with a current product. I once interviewed at a company that did that
>>>> to me. I was presented with a large schematic of the product, and
>>>> asked to critique the design. After a few minutes of hasty back of
>>>> the envelope calculations, I declared the product to be over-designed,
>>>> a tolerance accumulation nightmare, and that there were several active
>>>> stages that were superfluous. I offered specific recommendations on
>>>> what should be changed. I then expect to be thanked for my brilliant
>>>> insights. Instead, I was diplomatically thrown out the door. It
>>>> seems that the manager that was conducting the interview had designed
>>>> the product, and did not take kindly to criticism. So much for a
>>>> relevant problem solving interview.
>>>
>>> You didn't want to work there, so it was a great interview.
>>>
>>> This is my first-pass qualifier question.
>>>
>>>
>>>
>>> +10V
>>> |
>>> |
>>> |
>>> |
>>> C
>>> +5V--------------B
>>> E
>>> |
>>> |
>>> 1K
>>> |
>>> |
>>> gnd
>>>
>>> (drawn like a real schematic, on a whiteboard)
>>>
>>> What is the base voltage? (one answer: 0.6!)
>>
>> During the dot.com bubble, I worked for a software company that would
>> (by way of analogy) have employed the person on the grounds that they at
>> least knew which was the base.
>
> With that answer? Are you sure? ;-)
>
>> Apparently, the management thought that
>> any 'programmer' was better than no programmer.
>
> Been there. It's taken some convincing, at times, to get management to
> understand that sometimes more people = less work. It's often too late to
> improve a schedule, by *any* means.
>

Getting a manager to understand that doing nothing is the best course
when something is running late - that's quite a feat.

Sylvia.

Jamie

unread,
Oct 24, 2012, 9:01:22 PM10/24/12
to
If you're in need for a low saturated switch and don't want to use mos
then I guess this would work..

But, beware of what you place at the emitter, I would think you need
to stay belong the zenering of the emitter..

Jamie

Jeff Liebermann

unread,
Oct 24, 2012, 8:47:32 PM10/24/12
to
On Tue, 23 Oct 2012 12:05:17 -0700, John Larkin
<jla...@highlandtechnology.com> wrote:

>You didn't want to work there, so it was a great interview.

Actually, I did want to work there, and probably would have been
willing to tolerate the manager. In retrospect, all he was doing was
defending his design and avoided hiring a potential troublemaker (me).

>This is my first-pass qualifier question.

I noticed that nobody actually answered the problem. So....
>
> +10V
> |
> C
>+5V--------------B
> E
> |
> 1K
> |
> gnd

>What is the base voltage?

5V

>What is the emitter voltage?

Assuming silicon, and not germanium,
5V - 0.6V = 4.4V

>What is the collector voltage?

10V

>What is the emitter current?

Ie = 4.4V / 1K = 4.4ma

>What is the collector current?

Assuming Beta = 100
Alpha = 100/(100+1) = 0.990
Ic = Alpha * Ie = 0.990 * 4.4ma = 4.36ma

>What is the base current?

4.40ma - 4.36ma = 0.044ma

>The best interview is to work on a real design problem, together on a
>whiteboard, for a couple of hours.

Agreed. The last engineer I hired (back in the early 1980's) was one
of maybe a dozen applicants that were filtered by HR. My boss gave me
about an hour each as he didn't want me to spend 12 days on
interviews. I wasn't hugely interested in what they knew. I was
interested in their willingness and abilities to learn new things. My
little memory test trick was my primary tool. There's not much that
can be done in an hour, especially with constant interruptions.
Eventually, about 4 people in engineering grilled the applicant. We
then compared notes and passed it on to whomever was going to make the
final decision. The overall batting average was lousy. We hired one
clown that instantly retired on the job. Another specialized in
finding excuses not to show up to work. Yet another acted like he was
still working for his previous employer. Spending a day with the
applicant would have brought much of this to the surface, but that
didn't happen.

There's also a problem hiring engineers in very small companies. At
literally all of my employers, engineers were directly involved in all
aspects of product development, production, QA, and documentation. We
needed a very versatile engineer, capable of doing more than just
engineering. I didn't care if the candidate knew how to do
everything. However, I did care if he was able to learn new skills. I
was hired at one company to do RF design work, but spent the first 6
months cleaning up my predecessors mess on the production line.

>I also like to ask people what they designed last, and to describe
>some circuits.

Yep. We also did that. However, I ran into one odd problem with an
engineer from Japan. I could see that he was competent. However, I
had great difficulty determining what he did at his previous employer.
It wasn't a big secret as it was all on his resume. Yet, he wouldn't
talk about it. I eventually determined that in Japan, he was
considered part of a team. Discussing a project without the inclusion
of the team was like taking personal credit for the teams
accomplishments. When I switched my questions to reflect the
accomplishments of the team, the answers were forthcoming.




--
Jeff Liebermann je...@cruzio.com
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558

John Larkin

unread,
Oct 24, 2012, 9:24:07 PM10/24/12
to
On Wed, 24 Oct 2012 19:39:44 -0400, "tm" <No_on...@white-house.gov>
wrote:
The BFT25 has super low capacitance.


--

John Larkin Highland Technology Inc
www.highlandtechnology.com jlarkin at highlandtechnology dot com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators

Robert Baer

unread,
Oct 25, 2012, 12:48:53 AM10/25/12
to
William Elliot wrote:
> On Tue, 23 Oct 2012, Robert Baer wrote:
>>> On 23/10/2012 4:20 PM, Sylvia Else wrote:
>>>> On 23/10/2012 12:31 PM, RichD wrote:
>
>>>>> What are the last 3 digits of 171 ^ 172?
>>>
>>> Indeed thinking along similar lines, one can write 171 as (170 + 1).
>>>
>>> So we need (170 + 1)^172 mod 1000.
>>>
>>> Again, only the last three terms can be non-zero mod 1000.
>>>
>>> a) (172 * 171) / 2 * 170^2
>>> b) 172 * 170
>>> c) 1
>>>
>>> a) is 56 * 171 * 170^2.
>>>
>>> 170^2 is 900 mod (square the 7, and drop the leading 4).
>>> Now mutiply by the 6 and 1, and drop the leading 5, gives 400.
>>>
>>> b) is 2 * 170 + 70 * 70 mod 1000 = 340 + 900 mod 1000.
>>>
>>> So the sum is 400 + 340 + 900 + 1 mod 1000, or, unsurprisingly 641.
>>>
>> I am reminded of another "puzzle": how many terminal zeros are there in
>> 4089! (4089 factorial)?
>
> 817. 5 divides every fifth number. 4089/5 = 817 + 4/5
>
>> Solve it in less that (say) ten minutes.
>> No electronic or mechanical calculator allowed.
>>
Incorrect answer; a lot more than that (remember, i said FACTORIAL,
which means 4089 * 4088 * 4087 * ... * 3 * 2 * 1).

Robert Baer

unread,
Oct 25, 2012, 12:50:37 AM10/25/12
to
William Elliot wrote:
> On Tue, 23 Oct 2012, Butch Malahide wrote:
>
>> On Oct 23, 11:59 pm, William Elliot<ma...@panix.com> wrote:
>>> On Tue, 23 Oct 2012, Robert Baer wrote:
>>>> I am reminded of another "puzzle": how many terminal zeros are there in
>>>> 4089! (4089 factorial)?
>>>
>>> 817. 5 divides every fifth number. 4089/5 = 817 + 4/5
>>
>> Wrong. Hint: 25! has 6 terminal zeros.
>>
> 5 divides every fifth number. 4089/5 = 817 + 4/5
> Anoher 5 divides every 25-th number. 4089/25 = 163 + 14/25
> Yet another 5 divides every 125-th number. 4089/125 = 32 + 89/125
> etc.
>
> Number of zero's
> = [4089/5] + [4089//25] + [4089/125] + [4089/625] + [4089//3125]
> = 817 + 163 + 32 + 6 + 1 = 1019.
>
>
>
YES!!
Correct solution AND correct method.

Robert Baer

unread,
Oct 25, 2012, 12:52:43 AM10/25/12
to
>>> You didn't want to work there, so it was a great interview.
>>>
>>> This is my first-pass qualifier question.
>>>
>>>
>>>
>>> +10V
>>> |
>>> |
>>> |
>>> |
>>> C
>>> +5V--------------B
>>> E
>>> |
>>> |
>>> 1K
>>> |
>>> |
>>> gnd
>>>
>>> (drawn like a real schematic, on a whiteboard)
>>>
>>> What is the base voltage? (one answer: 0.6!)
>>
>> During the dot.com bubble, I worked for a software company that would
>> (by way of analogy) have employed the person on the grounds that they at
>> least knew which was the base.
>
> With that answer? Are you sure? ;-)
>
>> Apparently, the management thought that
>> any 'programmer' was better than no programmer.
>
> Been there. It's taken some convincing, at times, to get management to
> understand that sometimes more people = less work. It's often too late to
> improve a schedule, by *any* means.
Well, there IS a way...fire absolutely everybody and dump the company..

RichD

unread,
Oct 25, 2012, 1:01:06 AM10/25/12
to
On Oct 23, Sylvia Else <syl...@not.at.this.address> wrote:
> >>> I saw this posed as an interview question:
>
> >>> (usual exponent notation)
> >>> What are the last 3 digits of 171 ^ 172?
>
> >>> Presumably, one is given pen and paper.
> >>> Is there a trick here?  The second digit isn't too tough,
> >>> but the third is a lot of work.
>
> >> That's a really stupid interview question for an electronic design
> >> position.
>
> > It would be a valid question if you apply for a job as a stock broker.

?

> Perhaps not even then. All the offered solutions require knowledge of
> congruences, which is part of basic number theory. Unless a person has
> done a maths degree, or happens to have encountered it in passing (my
> situation), they're unlikely to be sure that the required steps are
> mathematically valid.

It's a firm that does financial modeling. They're recruiting people
to write code, for statistical analysis etc.; quants, not brokers.

It's a very good question for such a position. OF course, you want
someone unafraid of math, but better yet, it requires some original
thinking, a problem that wasn't on the exam.

--
Rich

k...@att.bizzzzzzzzzzzz

unread,
Oct 25, 2012, 8:45:01 AM10/25/12
to
On Wed, 24 Oct 2012 20:52:43 -0800, Robert Baer <rober...@localnet.com>
wrote:
That certainly an option but it doesn't meet the stated goals.

RichD

unread,
Oct 26, 2012, 7:38:49 PM10/26/12
to
On Oct 22, William Elliot <ma...@panix.com> wrote:
> > What are the last 3 digits of 171 ^ 172?
> > Is there a trick here?
>
> a = 171;  d = 1000
> b = 172 = 128 + 32 + 8 + 4
>
> Calculate:
> a^2 mod d = 241
> a^4 = (a^2)^2 mod d = 241^2 mod d = 81
>
> a^8 = (a^4)^2 mod d
> a^32 = (a^8)^4 = [(a^8)^2]^2 mod d
> a^128 = (a^32)^4 = [(a^32)^2]^2 mod d
>
> and use those results to calculate
> a^172 = a^128 a^32 a^8 a^4 mod d.

Yes, that's probably what they expect, and would
get you the job. It's not too much work.

I did it by looking at periodicities in the second digit, as one
does the multiplications. But that became excessive, in
the third digit.

But I wonder if there are some obscure number theory short
cuts. Which might give you a leg up on other candidates,
though it's doubtful the interviewers expect that.

--
Rich

RichD

unread,
Oct 26, 2012, 7:41:44 PM10/26/12
to
On Oct 22, Sylvia Else <syl...@not.at.this.address> wrote:
> > What are the last 3 digits of 171 ^ 172?
> > Presumably, one is given pen and paper.
>
> > Is there a trick here?  The second digit isn't too tough,
> > but the third is a lot of work.
>
> Don't know about a trick. After noting the (*) result below using a
> caculator, I managed to get the right answer from scratch on a
> whiteboard, but I doubt I'd have managed to do it in an interview
> environment.
>
> Anyway, since we're only looking at the last three digits, we can do
> calculations mod 1000.

In modulo arithmetic, I thought the modulo had to be a prime number.

> Also, note that 172 is 4 * 43.
>
> Doing 171^2 by long multiplication, keeping only the last three digits
> gives 241.
> 241^2 by long multiplication, keeping only the last three digits is 81.
> So 171^4 = 81 mod 1000 (this is the * result) and 171^172 = 81^43 mod
> 1000 = 9^86 mod 1000.
>
> Now 9 is 10 - 1, so we have 171^172 = (10 - 1)^86 mod 1000.
>
> If we were to expand that using the binomial theorem, all the terms
> would by multiples of 1000, and therefore unimportant, except the last
> three.
>
> The last three are
>
> a)(86 * 85) / 2 * 10^2 * (-1)^84,
> b) 86 * 10^1 * (-1)^85, and
> c)(-1)^86.
>
> a) can also be written 43 * 85 * 100, and since we're taking it modulo
> 1000, we need only multiply the 3 by the 5, giving 15, and keep only the
> 5, so a) is 500 mod 1000.
>
> b) is -860
>
> c) is 1
>
> So the result is 500 - 860 + 1 = -359 mod 1000.
> But that's negative, so add 1000 to make it positive, and the answer is 641.

Is there anything special about 171 and 172?

--
Rich


0 new messages