Author Archive: Paul Epps

Competitive Programming: SPOJ – The Bulk!

 

ACM uses a new special technology of building its transceiver stations. This technology is called Modular Cuboid Architecture (MCA) and is covered by a patent of Lego company. All parts of the transceiver are shipped in unit blocks that have the form of cubes of exactly the same size. The cubes can be then connected to each other. The MCA is modular architecture, that means we can select preferred transceiver configuration and buy only those components we need . The cubes must be always connected “face-to-face”, i.e. the whole side of one cube is connected to the whole side of another cube. One cube can be thus connected to at most six other units. The resulting equipment, consisting of unit cubes is called The Bulk in the communication technology slang. Sometimes, an old and unneeded bulk is condemned, put into a storage place, and replaced with a new one. It… Read more →

Sports Media Questions That Could be Retired

 

“How important is it to get off to a good start today, Skipper?” “Do you know of any sports where participants try to get off to a bad start?” “Uh . . . no.” “Nor do I. That said, we always try to get off to a good start. And when we don’t, we try to come back and win anyway.” Read more →

More Words and Phrases I’m Sick Unto Death Of: Coming Forward

 

You’re the accuser. You get on the witness stand. You testify. You make your accusation. You get cross-examined. THEN the accused responds. It turns the entire legal system on its head. It is INSANE to ask an accused person to deny the accusation before he has heard the accusation being made and cross-examined. — Alan Dershowitz I’m tired of the phrase “coming forward” being used to describe people making unsubstantiated allegations, because it presumes the truth of something that’s unknown and, in some cases, unknowable. The burden is still on the accuser, thank god for all of us. I “come forward” to accuse you — via the media, on Twitter, wherever — of having done a bad thing decades ago in high school. I don’t remember the details of when or where or who else was present, but now that you’ve been credibly accused, how do you respond to this… Read more →

Competitive Programming: SPOJ – Build the Fence

 

At the beginning of spring all the sheep move to the higher pastures in the mountains. If there are thousands of them, it is well worthwhile gathering them together in one place. But sheep don’t like to leave their grass-lands. Help the shepherd and build him a fence which would surround all the sheep. The fence should have the smallest possible length! Assume that sheep are negligibly small and that they are not moving. Sometimes a few sheep are standing in the same place. If there is only one sheep, it is probably dying, so no fence is needed at all … Input t [the number of tests <= 100] [empty line] n [the number of sheep <= 100000] x1 y1 [coordinates of the first sheep] … xn yn [integer coordinates from -10000 to 10000] [empty line] [other lists of sheep] Text grouped in [ ] does not appear in the input file.… Read more →

Teaching Computer Science: You Just Got to Really Want To

 

I’m volunteering a couple mornings a week in a high school computer science class . . . “Does anyone recognize this gentleman?” No one does. “Any pianists in the class?” About 5 kids raise their hands. “Do you ever go to YouTube and watch videos of pieces that you’re trying to learn?” Yes, they do. “Ok, this is Vladimir Horowitz.” Last time around, no one was able to identify Martha Graham. “I always know the name after you say it though,” one girl says. “Well, there’s more to life than technology, kids. There’s music, art, dance, literature . . . all these things help blow the dust off our ordinary existence. “I’ll get back to Horowitz in a minute. Last time I was here, I heard a conversation about how hard is it to go to college as a CS major. “I have some good news and bad news. I’ll… Read more →

Competitive Programming: POJ 2185 – Milking Grid

 

Description Every morning when they are milked, the Farmer John’s cows form a rectangular grid that is R (1 <= R <= 10,000) rows by C (1 <= C <= 75) columns. As we all know, Farmer John is quite the expert on cow behavior, and is currently writing a book about feeding behavior in cows. He notices that if each cow is labeled with an uppercase letter indicating its breed, the two-dimensional pattern formed by his cows during milking sometimes seems to be made from smaller repeating rectangular patterns. Help FJ find the rectangular unit of smallest area that can be repetitively tiled to make up the entire milking grid. Note that the dimensions of the small rectangular unit do not necessarily need to divide evenly the dimensions of the entire milking grid, as indicated in the sample input below. Input Line 1: Two space-separated integers: R and C… Read more →

Teaching Computer Science: Say Your Ideas Out Loud

 

[I learned about Scary Ideas from Jim and Michele McCarthy — PE] I’m volunteering a couple mornings a week in a high school computer science class . . . “The main thing I wanted to tell you is that you’ve got to say your ideas out loud . . . “A scary idea is not an idea that’s going to scare people when they hear it, it’s an idea that you don’t want to say because you’re afraid of how people will react to it. Maybe they’ll think you’re crazy. “Here’s a couple examples of scary ideas. “You recognize the speaker in this video?” Everyone does. “Ok, let’s see what he has to say.” I believe that this nation should commit itself to achieving the goal, before this decade is out, of landing a man on the moon and returning him safely to the earth. “Keep in mind that he’s… Read more →

A Close Encounter with Burt Reynolds’ Legacy

 

I’m having dinner at a Japanese restaurant . . . in the booth behind me are a couple straight out of Sons of Anarchy. The man is about 45, large, with a shaved head, tattoos and a motorcycle jacket. Same description for the woman, except for the shaved head. Her jacket is emblazoned with PROPERTY OF TROG (or FROG or ????, couldn’t make it out clearly), which I assume is the name of either a motorcycle gang or the gentleman sitting across from her. Midway through the meal, Trog wonders aloud if Smokey and the Bandit is available on Netflix. To his chagrin, the movie doesn’t seem to register with his girlfriend, so to jog her memory, he pulls up the “Eastbound and Down” song on his phone and plays it loudly enough to be heard by everyone in the vicinity. He then launches into an analysis of the film… Read more →

Competitive Programming: POJ 1147 – Binary Codes

 

Description Consider a binary string (b1…bN) with N binary digits. Given such a string, the matrix of Figure 1 is formed from the rotated versions of the string. b1 b2 … bN-1 bN b2 b3 … bN b1 … bN-1 bN … bN-3 bN-2 bN b1 … bN-2 bN-1 Figure 1. The rotated matrix Then rows of the matrix are sorted in alphabetical order, where ‘0’ is before ‘1’. You are to write a program which, given the last column of the sorted matrix, finds the first row of the sorted matrix. As an example, consider the string (00110). The sorted matrix is 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 0 0 and the corresponding last column is (1 0 0 1 0). Given this last column your program should determine the first row, which is… Read more →

Competitive Programming: POJ 1961 – Period

 

Description For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <= i <= N) we want to know the largest K > 1 (if there is one) such that the prefix of S with length i can be written as AK, that is A concatenated K times, for some string A. Of course, we also want to know the period K. Input The input consists of several test cases. Each test case consists of two lines. The first one contains N (2 <= N <= 1,000,000) – the size of the string S. The second line contains the string S. The input file ends with a line, having the number zero on it. Output For each test case, output “Test… Read more →

Teaching Computer Science: All Are Welcome

 

I’m volunteering a couple mornings a week in a high school computer science class . . . “Computing,” I tell the class, “is like most professions in that some groups are under-represented and some groups are over-represented. You may have heard that the reason some groups are under-represented is because computing as a profession is more welcoming to some people than others. “I haven’t found that to be the case and I’ll tell you why. “My perspective on this is that if you walk through the workplace at a typical technology company, you won’t see people who look like me. I’m too old and I’ve been too old for quite a while now. At this point, I’m usually old enough to be the CEO’s father. “So to the extent that people want to work with other people who look like them and people who fit into the group, that doesn’t… Read more →

EppsNet Book Reviews: An Inconvenient Woman by Dominick Dunne

 

It’s a good murder mystery, but about two-thirds of the way through, I felt like I couldn’t indulge the author’s sexual obsessions any further and just flipped ahead to see whodunit. Every man has either “a dick like a mule” or “a dick like a Tampax.” No one has ” a dick of average proportions.” Sexual relationships are either non-existent (with one’s wife) or preposterously frequent and varied (with one’s mistress(es)). One unlikely plot device is premised on a particular woman’s “most intimate scent.” I’d suggest that the author have his head examined but he’s been dead for nearly 10 years . . . Read more →

Teaching Computer Science: Don’t Worry About Spelling and Grammar?

 

The following is part of the Code.org online curriculum, asking students to write a brief reflection on starting a computer science class. That seems like an oddball thing to say in an educational context. “Let’s talk about the instructions here for a minute,” I said to the class. “One: it doesn’t make sense to me to compartmentalize education like this. Like spelling and grammar are only important in an English class and this is not an English class so don’t worry about it. “We’ll be taking a holistic view of education here. I hope you’ll learn some things about computer science but I hope you’ll learn some other things as well. “On a practical note, you may find yourself competing for a job someday, and if it’s a good job, there are likely to be a lot of applicants. “No one wants to read a large number of resumes, so… Read more →

Teaching Computer Science: Why Was I Not Consulted?

 

I’m volunteering in a high school computer science class a couple mornings a week . . . If you’re going to work with computers, you need to be able to move around between different number systems, most commonly base 10, base 2 and base 16. As a warm-up, I asked students how many ways they could represent the quantity 7. Answers included the word “seven,” roman numerals, seven dots, a septagon, a Chinese symbol, and so on. “Quantities exist naturally,” I said, “but number systems are man-made. They’re just a set of symbols along with an agreement about how to order them. Why do we use the number system that we do? Who decided that?” Because I phrased it in a provocative way, some students realized that they hadn’t been consulted. “Yeah, no one asked me,” one student said. “Raise your hand in math class,” I suggested, “and ask ‘Why… Read more →

Competitive Programming: POJ 2074 – Line of Sight

 

Description An architect is very proud of his new home and wants to be sure it can be seen by people passing by his property line along the street. The property contains various trees, shrubs, hedges, and other obstructions that may block the view. For the purpose of this problem, model the house, property line, and obstructions as straight lines parallel to the x axis: Input Because each object is a line, it is represented in the input file with a left and right x coordinate followed by a single y coordinate: <x1> <x2> <y> where x1, x2, and y are non-negative real numbers, x1 < x2 . An input file can describe the architecture and landscape of multiple houses. For each house, the first line will have the coordinates of the house. The second line will contain the coordinates of the property line. The third line will have a… Read more →

Company Picnic

 

A highly placed manager at work shows up next to me in the men’s room. “You going to the company picnic?” he shouts. He’s a boisterous guy. “Yes!” I reply. “Looking forward to taking a few throws at you in the dunk tank.” “Dunk tank?!” he says. “There’s not going to be any dunk tank.” “Oh . . . in that case I’m not going.” Read more →

« Previous PageNext Page »